Add more info to apply messaging

This commit is contained in:
William Wernert
2021-02-22 15:50:07 -05:00
parent 3e3c923ab9
commit fb3af255d9

View File

@@ -40,17 +40,18 @@ def check_apply(args: dict, prompt: bool = True):
cmd_arr = ['salt-call', 'state.apply', 'idstools', 'queue=True'] cmd_arr = ['salt-call', 'state.apply', 'idstools', 'queue=True']
if args.apply: if args.apply:
print('Applying idstools state...') print('Configuration updated. Applying idstools state...')
return subprocess.run(cmd_arr) return subprocess.run(cmd_arr)
else: else:
if prompt: if prompt:
message = 'Would you like to apply your changes now? (y/N) ' message = 'Configuration updated. Would you like to apply your changes now? (y/N) '
answer = input(message) answer = input(message)
while answer.lower() not in [ 'y', 'n', '' ]: while answer.lower() not in [ 'y', 'n', '' ]:
answer = input(message) answer = input(message)
if answer.lower() in [ 'n', '' ]: if answer.lower() in [ 'n', '' ]:
return 0 return 0
else: else:
print('Applying idstools state...')
return subprocess.run(cmd_arr) return subprocess.run(cmd_arr)
else: else:
return 0 return 0