You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use oxs to apply announcement banner to JunOS. Commands come from file, something like this: configure set system announcement "\nThis is my announcement\n123\n" commit and-quit quit
Above fails. When running in debug mode I can see that oxs is interpreting newline (and so actually enters newline into Junos CLI instead of \n as text).
I have tried escaping \n with additional , but that still fails, so I started looking into why. I spotted line 85 in cli.rb:
line.sub!(/\\n/, "\n") # tread escaped newline as newline
I don't know ruby, but to me it looks like it does exactly what comment says (no surprise here), but I am trying to figure out why it does this. For a quick test I have changed this line to:
line.sub!(/\\n/, "\\n") # tread escaped newline as newline
which to me means that it will replace new line with escaped new line. This makes my above command list apply successfully.
As mentioned above I don't know ruby enough to be able to evaluate what could my change break, so I have reverted it for now and decided to ask for some advice here.
Hope above is clear enough.
The text was updated successfully, but these errors were encountered:
So, commenting out the newline appears to have fixed the issue, with no known side-effects. I've added it to my most recent PR and am just waiting on ytti to accept the PR (#10)
I am trying to use oxs to apply announcement banner to JunOS. Commands come from file, something like this:
configure
set system announcement "\nThis is my announcement\n123\n"
commit and-quit
quit
Above fails. When running in debug mode I can see that oxs is interpreting newline (and so actually enters newline into Junos CLI instead of \n as text).
I have tried escaping \n with additional , but that still fails, so I started looking into why. I spotted line 85 in cli.rb:
line.sub!(/\\n/, "\n") # tread escaped newline as newline
I don't know ruby, but to me it looks like it does exactly what comment says (no surprise here), but I am trying to figure out why it does this. For a quick test I have changed this line to:
line.sub!(/\\n/, "\\n") # tread escaped newline as newline
which to me means that it will replace new line with escaped new line. This makes my above command list apply successfully.
As mentioned above I don't know ruby enough to be able to evaluate what could my change break, so I have reverted it for now and decided to ask for some advice here.
Hope above is clear enough.
The text was updated successfully, but these errors were encountered: