11-16-2019 05:11 PM
Hi I'm having some trouble running this script. I'm trying to edit the configuration I have but I encounter this:
CODE
============================================================
Solved! Go to Solution.
11-17-2019 05:57 AM
Hello guys again! I've editing my code and the thing is that if you delete from the netconf_reply variable the target you will receive the RPC-reply ok
netconf_reply = m.edit_config(netconf_payload)
Sorry! And I hope it helps!
11-17-2019 05:57 AM
Hello guys again! I've editing my code and the thing is that if you delete from the netconf_reply variable the target you will receive the RPC-reply ok
netconf_reply = m.edit_config(netconf_payload)
Sorry! And I hope it helps!
01-08-2020 02:18 PM
I was having the same problem but when I remove the target I will get a ok reply but the configuration is not changing
01-29-2020 09:51 AM - edited 01-30-2020 12:43 AM
Hi there,
The solution specified will not work since you are not changing anything if you do not specify the target. You will still receive the "OK" message but the changes you have done will not affect the device.
According to ncclient docs "Where a method takes a source or target argument, usually, a datastore name or URL is expected. The latter depends on the: URL capability and on whether the specific URL scheme is supported. Either must be specified as a string. For example, “running”, “ftp://user:pass@host/config”."
You probably have the configuration
netconf-yang feature candidate-datastore
which will transform "running" mode to "candidate".
To solve an issue you can remove the command from a device as follows,
no netconf-yang feature candidate-datastore
It works even if you change target="candidate". You will still receiving OK message but actually nothing changed in the device. To make changes transfer to running-config you need to send m.commit() command within the script after edit_config command.
According to ncclient documentation commit(confirmed=False, timeout=None, persist=None)
A confirmed commit (i.e. if confirmed is True) is reverted if there is no followup commit within the timeout interval. If no timeout is specified the confirm timeout defaults to 600 seconds (10 minutes). A confirming commit may have the confirmed parameter but this is not required. It depends on the: confirmed-commit capability.
My device is ASR1004 with IOS XE 16.9.4 just for info.
Hope it will help those who struggle on it like I was struggling while watching "Cisco Life"))
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide