Scrapli NETCONF copy-config issue with config as multiline-string #120
Unanswered
willikubny
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Probably want logs to see whats up, example -> here It looks like things time out during the copy config operation so yeah, just gotta see whats up with that. Could also try to crank the timeout up if its a big config or the device is being a bit slow about it. HTH |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone
I'm working with Nornir, but as no copy-config task exist at the moment, I've tried to work directly with Scrapli NETCONF.
I'm trying to copy the whole Cisco-IOS-XE-native NETCONF configuration to the candidate datastore and get the following traceback:
Traceback (most recent call last): File "/Users/willikubny/PythonVirtualEnv/zis_iac/./dev_copy_config.py", line 1642, in <module> main() File "/Users/willikubny/PythonVirtualEnv/zis_iac/./dev_copy_config.py", line 1624, in main result = conn.copy_config(source=SOURCE_CONFIG, target="candidate",) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli_netconf/driver/sync_driver.py", line 369, in copy_config raw_response = self.channel.send_input_netconf(response.channel_input) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli_netconf/channel/sync_channel.py", line 238, in send_input_netconf buf, _ = super().send_input(channel_input=channel_input, strip_prompt=False, eager=True) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/decorators.py", line 235, in decorate return wrapped_func(*args, **kwargs) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/channel/sync_channel.py", line 478, in send_input self.write(channel_input=channel_input) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/channel/base_channel.py", line 336, in write self.transport.write(channel_input=channel_input.encode()) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli_netconf/transport/plugins/system/transport.py", line 67, in write self.session.write(bytes_to_send.read(self.write_chunk_size)) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/transport/plugins/system/ptyprocess.py", line 517, in write n = self.fileobj.write(bytes_to_write) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/decorators.py", line 75, in _signal_raise_exception return _handle_timeout(transport=transport, logger=logger, message=message) File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/decorators.py", line 133, in _handle_timeout transport.close() File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/transport/plugins/system/transport.py", line 140, in close self.session.close() File "/Users/willikubny/.envs/zis_iac/lib/python3.9/site-packages/scrapli/transport/plugins/system/ptyprocess.py", line 439, in close raise PtyProcessError("Could not terminate the child.") scrapli.transport.plugins.system.ptyprocess.PtyProcessError: Could not terminate the child.
If I just copy the running datastore to the candidate datastore with copy-config, then it's working, which makes me guessing that in general it's working and I have some sort of issue with my source of the copy-config.
My test script is simple:
I didn't found any helpful information yet and appreciate every feedback.
An example of what I try to do would be amazing.
Beta Was this translation helpful? Give feedback.
All reactions