Running my Python code would return the following exception:
netmiko_send_config*************************************************************
* Router-1 ** changed : False **************************************************
vvvv netmiko_send_config ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
Traceback (most recent call last):
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir\core\task.py", line 99, in start
r = self.task(self, **self.params)
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir_netmiko\tasks\netmiko_send_config.py", line 36, in netmiko_send_config
net_connect.enable()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\cisco_base_connection.py", line 26, in enable
return super().enable(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 2042, in enable
output += self.read_until_prompt()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 837, in read_until_prompt
return self.read_until_pattern(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 746, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'R1' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
^^^^ END netmiko_send_config ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* switch-1 ** changed : False **************************************************
vvvv netmiko_send_config ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
Traceback (most recent call last):
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir\core\task.py", line 99, in start
r = self.task(self, **self.params)
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir_netmiko\tasks\netmiko_send_config.py", line 36, in netmiko_send_config
net_connect.enable()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\cisco_base_connection.py", line 26, in enable
return super().enable(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 2042, in enable
output += self.read_until_prompt()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 837, in read_until_prompt
return self.read_until_pattern(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 746, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'SW1' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
^^^^ END netmiko_send_config ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* switch-2 ** changed : False **************************************************
vvvv netmiko_send_config ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
Traceback (most recent call last):
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir\core\task.py", line 99, in start
r = self.task(self, **self.params)
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\nornir_netmiko\tasks\netmiko_send_config.py", line 36, in netmiko_send_config
net_connect.enable()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\cisco_base_connection.py", line 26, in enable
return super().enable(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 2042, in enable
output += self.read_until_prompt()
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 837, in read_until_prompt
return self.read_until_pattern(
File "C:\Users\pc\Desktop\python_programmability\llpyAuto01\lib\site-packages\netmiko\base_connection.py", line 746, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'SW2' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
^^^^ END netmiko_send_config ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netmiko_send_config*************************************************************
netmiko_send_config*************************************************************
netmiko_send_config*************************************************************
I'm using Nornir with Netmiko to deploy configuration on cisco IOS routers as follow:
groups YAML file that contains: groups.yaml
hosts YAML file: hosts.yaml
defaults YAML file: defaults.yaml
config YAML file: config.yaml
Running my Python code would return the following exception:
Please help resolve the issue, thanks in advance.