Closed parth995 closed 2 years ago
Have you tried to manually execute a configure replace
with the file ('run_config') that you are uploading?
Hey @ktbyers , Thanks for your reply. I am not getting how you would like to test it manually. I have noticed a thing that it isn't able to apply banner motd which contains special chars symbols (^C).
Tried with one more device :-
napalm.base.exceptions.ReplaceConfigException: Candidate config could not be applied
Failed to apply command ^C
Aborting Rollback.
I suspect issue is due to mentioned at https://napalm.readthedocs.io/en/latest/support/ios.html#banner Would you be able to share some way to tackle this ?
So I tried it using ansible too. I got same error mentioned above (most probably due to banner motd message and special char ^C)
name: capture show output hosts: ios-xe-mgmt-latest.cisco.com gather_facts: no
tasks:
If I try to remove banner motd message from config file that i wanted to push and give a try it works like a charm
Have you removed the banner and observed whether the configuration change works or fails?
Also did you follow the instructions here for properly formatting the banner (it is tricky).
https://napalm.readthedocs.io/en/latest/support/ios.html#banner
Yeah by removing banner it works fine and config is getting replaced. Let me try steps in that doc too
Worried as this steps just appends a different banner motd message in file. How about eliminating existing banner motd message in our stored config which contains (^C) ?
Description of Issue/Question
I am facing error replacing whole running config on IOS network device.
Note: Please check https://guides.github.com/features/mastering-markdown/ to see how to properly format your request.
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
(Place an
x
between the square brackets where applicable)Setup
I have a cisco sandbox device running IOS XE and python script to restore device config from one pre-existing file storing running config of a device.
Code is as below : ` from napalm import get_network_driver import json
driver = get_network_driver('ios') device = driver(hostname='ios-xe-mgmt-latest.cisco.com', username='developer', password='C1sco12345', )
device.open()
device.load_replace_candidate(filename='run_config') print('\n Diff:') diff = device.compare_config() print(diff)
if len(diff) < 1: print('\nNo Changes Required Closing...') device.discard_config() exit()
try: choice = input("\nWould you like to Replace the Configuration file? [yN]: ") except NameError: choice = input("\nWould you like to Replace the Configuration file? [yN]: ") if choice == 'y': print('Committing ...') device.commit_config() else: print('Discarding ...') device.discard_config()
print('Done.') `
napalm version
(Paste verbatim output from
pip freeze | grep napalm
between quotes below)Network operating system version
(Paste verbatim output from
show version
- or equivalent - between quotes below)Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)