-
Notifications
You must be signed in to change notification settings - Fork 546
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
Cisco IOS merge and compare_config should generate an exception #224
Comments
Kirk, would it work to use the current running-config, append the changes at the end and use that file to compare? Worst case, I think the best option would be to return the merge configuration instead of returning an Exception. |
@dbarrosop No, just appending on to the end of running-config wouldn't work. A merge file could have 'no' commands. It could also have no to entire sections of config. For example, 'no router bgp 10'. You could also have merge config commands that modify a hierarchy 'router bgp 10 > neighbor 1.1.1.1 remote-as 20. Yes, I think an exception is better than just returning the contents of the merge file. Returning the contents of the merge file gives the user a false sense of confidence (i.e. that it is actually doing a real comparison). I guess we could prepend it with the message "Config merge not supported on Cisco IOS...returning merge config file contents" so that we made it clear in the output what it was doing. That way you wouldn't get an exception. |
You are right. If we are going to throw an Exception I guess it's worth creating a new one, something like UnsupportedByDevice. I don't want to reuse NotImplementedException because that one means we haven't implemented it. |
Merge operation should not generate this error: (venv) ~/Documents/Projects/acl_manager$ python zz_napalm.py |
@dbarrosop Note, from seeing what other users are expecting here. I changed my mind on this...I think I am going to implement .compare_config() and a merge operation to just echo the merge_config file (i.e. the changes the end-user submitted) with a comment stating that is what it is doing. |
Sounds good to me. Add it to the caveats : ) |
Okay, this is what this looks like on a compare_config() for merge operation.
for a merge_file.txt that contains
|
This issue has been 'moved' to napalm-automation/napalm-ios#26 |
No description provided.
The text was updated successfully, but these errors were encountered: