-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfirm.py
More file actions
29 lines (27 loc) · 769 Bytes
/
confirm.py
File metadata and controls
29 lines (27 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
This module controls the confirmation of pushing and pulling function
from the user.
"""
import initialize
from multithread import multithread_engine
def confirm(redirect,commands,authentication):
index = 0
if(redirect[index] == 'push_cfgs'):
try:
check = str(input("Push configs? [y/N]: ")).strip()
except KeyboardInterrupt as error:
print('[>] Terminating...')
exit()
else:
check = str(input("Pull configs? [y/N]: ")).strip()
try:
if check[0] == 'y':
multithread_engine(initialize.ntw_device,redirect,commands,authentication)
elif check[0] == 'N':
return False
else:
print("RuntimeError: aborted at user request")
except Exception as error:
print("ExceptionError: an exception occured")
print(error)
return None