-
Notifications
You must be signed in to change notification settings - Fork 345
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
Do not fail on warnings #358
Comments
Hi @XioNoX, This is under consideration, but we may not change this behavior. ncclient passes this back to us as an rpc-error - which is correct per the RFC https://tools.ietf.org/html/rfc4741#section-4.3 We are also only given back the first rpc-error instance from ncclient leopoul/ncclient#54 Because of this, if we were to pass on a warning, it's very likely there could be a nested error we do not see that that should not be passed. Further more there is larger community to support that generally relies on such guardrails within their automation. We shouldn't be committing bad configs. -Rick |
Thanks for your reply, I'll follow that ncclient bug# In the meantime, knowing all the risks, do you have a pointer or a quick hack to ignore warnings (at least on config load)? |
You can put the operation in a try/catch and snag the severity from the exception untested example except ConfigLoadError as e:
if e.rpc_error['severity'] == 'warning':
pass
else:
raise |
We should be able to get this into 2.0.0 as the underlying mechanism will be supported in the next release of ncclient. |
We got this out in 1.3.1 |
Currently, if for example a load config returns warnings, the whole process will fail.
It would be useful to be able to ignore them.
I think that work kind of started in https://groups.google.com/d/msg/junos-python-ez/S2s0DnT_n3o/whUzKeOsmz4J
The text was updated successfully, but these errors were encountered: