File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,25 +3,25 @@ from netmiko.ssh_exception import NetMikoTimeoutException
3
3
from paramiko.ssh_exception import SSHException
4
4
from netmiko.ssh_exception import AuthenticationException
5
5
6
-
6
+ #read text file with comands to run
7
7
def commands():
8
8
with open('commands') as f:
9
9
commands_to_send = f.read().splitlines()
10
10
return commands_to_send
11
11
12
-
12
+ #read text file with list of devices to iterate through
13
13
def devices():
14
14
with open('devices') as f:
15
15
devices_list = f.read().splitlines()
16
16
return devices_list
17
17
18
-
18
+ #user input for username and password (for security use getpass)
19
19
def user_pass():
20
20
username = input("username: ")
21
21
password = input("password: ")
22
22
return username, password
23
23
24
-
24
+ #Main loop to call devices
25
25
def main():
26
26
u, p = user_pass()
27
27
for device in devices():
@@ -33,7 +33,7 @@ def main():
33
33
'username': u,
34
34
'password': p
35
35
}
36
-
36
+ #netmiko ConnectHandler and connection error handling
37
37
try:
38
38
net_connect = ConnectHandler(**ios_device)
39
39
except AuthenticationException:
You can’t perform that action at this time.
0 commit comments