-
Notifications
You must be signed in to change notification settings - Fork 556
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
Junos: pass self.ignore_warning in compare_config() to match behavior of commit_config() #1480
Junos: pass self.ignore_warning in compare_config() to match behavior of commit_config() #1480
Conversation
No, we would need an argument that was passed in via optional_args on init. The default would need to be False i.e. the warnings would not be ignored. I don't think it is proper to have it just ignore the warning by default here (since the thing it is warning about is pretty dangerous: changing a set of ports including other ports to a different potentially non-working speed). I.E. ports beyond what you explicitly configured are being changed. Also, we would need a fix for the rollback issue on ignore_warnings. At a minimum gracefully catching the exception that Junos generates (since the rollback does in fact go through). Also the optional_args argument should probably be more specific than just Regards, Kirk |
It is currently using the This is for the PyEZ's I agree that the name is not great. Setting the "ignore_*" at the driver level has always made me a bit uncomfortable -- usually when we get warnings, it's only for a specific operation where we are expecting the issue. I worry that someone will accidentally re-use the connection to do something else before or after the critical step(s). An argument to the function seems like it would be safer, but I think that goes against the design of napalm. |
@ekoyle Okay, good point. I didn't realize there was an already existing ignore_warning that was used for commit_config. Yeah, in order to add an argument for the method, we would need to add the argument to all of the NAPALM core drivers and possibly need to retrofit additional tools that are built on top of NAPALM (like napalm-ansible for example). I think adding it as init argument is probably better here (with default to False so you have to explicitly say you are okay with ignoring the warnings). |
@dbarrosop can you take a look at this since you merged the |
Please don't ping other individuals directly. It is not really fair to them. It will likely be either myself or Mircea reviewing this change, most likely me since I already started working on it. |
Very quickly, I think I'm fine to reuse the same |
If py-junos-eznc pull 1131 gets merged, we could make a similar change for the For reference, setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
Pass
ignore_warning
to device.cu.diff, since the API accepts it.Edit: On devices with
ignore_warning
set, a diff with warnings will raise an exception, even though a commit will succeed. This change allows the diff to succeed in cases a commit would. There is a similar issue with discard/rollback, however PyEZ does not currently acceptignore_warning
for the rollback call.