10000 016 add editable hosts file. Prevents editing main script · stephen-codepython/100DaysOfCode@6fb63d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fb63d6

Browse files
committed
016 add editable hosts file. Prevents editing main script
1 parent fa5f7b8 commit 6fb63d6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

016/hosts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HOSTS = ['192.168.0.1', '192.168.0.2', 'myhost.domain']

016/ssh_check_hostnames.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import paramiko
22
from contextlib import contextmanager
33

4+
from hosts import HOSTS
5+
46
username = ''
57
password = ''
6-
host_list = []
8+
host_list = HOSTS
79

810
#@contextmanager
911
def check_hostname(host_list):

0 commit comments

Comments
 (0)
0