-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for SROS SAR 7705 Hmc #2887
Conversation
Not sure why the CI tests fail on unchanged files. Is this a CI bug? |
The "\n" in the end of admin display-config lines causes empty configurations to be commited on SAS M devices.
|
Hi Raunz, I also encountered this on some devices. It is a pity as it was an elegant solution to get the HMC working. So I think I have to add the 7705HMC as a separate device (i.e. sroshmc) and revert the change for sros. I will test and try a bit more. |
There are also other options
or scrub the excess empty line from output. But we'd really need to understand what the actual problem is. What does the CLI session look like for 1 affected command on working and non-working platform? |
The reason this patch was made in the first place, is that for the SAR-Hmc the output of the commands "admin display-config index" and "admin display-config" does not end with a new line. Because of that, the prompt does not match anymore, as it is behind the last row of the output.
While on all the other sros devices you should see:
The idea was to just add an extra \n in the command, so you would get an extra newline pressed and a new prompt on a separate line.
This seemed to work for both the Hmc and the other sros devices. But it also seems to lead to issues for @raunz with the SAS-M, and I encounter myself an issue with IXR-e devices. What I see happening is:
I find it strange that these devices interpret the \n as backslash+n instead of a real newline. Is this also what you see on the SAS-M @raunz ? I ask this because if we see the same issue, I know which issues to resolve. And @ytti, is there a way to send a real new line with the cmd command? |
I'm pretty sure this is not desired behaviour and Nokia will eventually change this , so any work to deal with this has to assume it'll also go away. Is there some command you can before that command, which terminates correctly and communicates which type of device it is? cmd "something_to_detectg_device" do |cfg|
@cmd_prefix = cfg..match /foo/ ? "\n" : ""
""
end
post do
# rest of stuff
cmd "whatever" + @cmd_prefix do |cg|
...
end
end However, considering this is going to be fixed, once someone opens case to Nokia, should we even bother about this, or should people run local copies of the model, until fixed by Nokia. |
I think you are right, this might ever change, but it could well be years or never for this to be fixed. Worst case, this issue could pop up on other new sros versions.
This would filter out all rows without a new line on the end. Effectively, this filters out only the last troubled row on the HMC router (containing only a #), and for other device types, it does not remove anything. |
It will change, just open ticket to Nokia. We had few similar issues when going to MD-CLI, all were addressed in timely manner. And if we should, should we change the prompt to allow Also have you verified that SROS does not support exec mode in ssh? In which case we don't rely on prompt detection at all. |
Allowing a #A:ROUTERNAME# was the first thing I tired, but I ran into many unwanted side effects. I will reach out to Nokia and see if they think this is a bug. Would not surprise me if they don't see it as a bug, then its something to either work around or accept as not working. |
If you have problems with Nokia let me know the ticket number, and I can use backchannels to ecalate. Also, did you try to use ssh exec mode? Then you do not depends on prompt detection, and it should work fine for you. |
I did some debugging with oxidized and "\n" are at the end of commands.
What I notice, that the backup interval has to be at least 1hour to trigger. The debug output of oxidized process is basically identical on both sequential runs. The telnet output differs only by missing entire "admin display-config" block. Not a single error message or anything. Full backup telnet log is 876 lines, partial is only 345. |
I would encourage to test with ssh with exec mode turned on cfg :ssh do
exec true
end This way we won't do any prompt detection, as we progrmamatically know when command has finished. Note, not all SSH implementation support exec mode, or support it correctly. But if it works, it is much more dependable than screenscraping for prompt. |
Pre-Request Checklist
rubocop --auto-correct
)rake test
)Description
The Nokia SROS model did not work on the SAR 7705 HMC due to an unexpected prompt at the end of two commands. With this small patch, a new correct command line is enforced, which makes Oxidized finish correctly on all SROS models.