can anyone help? I got an error when I was trying to test a simple code with napalm. I used cisco on GNS3. I also added optional arguments (delay_factor), but it got the same error.
from napalm import get_network_driver
driver = get_network_driver("ios")
others = {
"secret" : "cisco",
"dest_file_system" : "nvram:",
'delay_factor': 5
}
device = driver(hostname="192.168.124.148", username="cisco", password="cisco", optional_args=others)
device.open()
device.load_merge_candidate(filename="candidate")
compare = device.compare_config()
print(compare)
device.commit_config()
device.close()
Traceback (most recent call last):
File "c.py", line 16, in <module>
device.commit_config()
File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/napalm/ios/ios.py", line 555, in commit_config
output += self.device.save_config()
File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/cisco/cisco_ios.py", line 37, in save_config
return super(CiscoIosBase, self).save_config(
File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/cisco_base_connection.py", line 224, in save_config
output = self.send_command(command_string=cmd)
File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/base_connection.py", line 1335, in send_command
raise IOError(
OSError: Search pattern never detected in send_command_expect: R\#
You can use the code that I have shared below.