I am trying to write a python script that will revert switchports back to default configuration. I have split the procedure into two separate files.
This file holds the code for the payload and calls the file below - NC_default_interface.py.
This contains the ncclient manager.connect section - NC_connect_to_device.py.
Whenever I run this code, interface G1/0/1 successfully gets reverted back to default configuration. However, on port G1/0/2, I get this error message.
</error-path><error-message xml:lang="en">resource denied: Sync is in progress</error-message><error-info><bad-element>default</bad-element>
</error-info>
I think the session needs to be closed and restarted for each port, but that is just a guess on my part.
I tried m.close and m.session_close(), but those just threw up different error messages.
I have attached the files in question. Thanks in advance.