- I have been using this link as guide.
XXXXXX:/Test # cat test2.py
from netmiko import ConnectHandler
with open('commands_ios') as f:
commands_list = f.read().splitlines()
cisco_D = {
'device_type': 'cisco_ios',
'host': '10.1.1.1',
'username': 'username',
'password': 'password',
}
net_connect = ConnectHandler(**cisco_D)
output = net_connect.send_config_from_file('commands_ios.txt')
print(output)
XXXXXX:/Test # python3 test2.py
Traceback (most recent call last):
File "test2.py", line 14, in <module>
output = net_connect.send_config_from_file('commands_ios.txt')
File "/usr/lib/python3.6/site-packages/netmiko/base_connection.py", line 1808, in send_config_from_file
with io.open(config_file, "rt", encoding="utf-8") as cfg_file:
FileNotFoundError: [Errno 2] No such file or directory: 'commands_ios.txt'
AL108564:/Test #