Arrange missing pillar error message better

This commit is contained in:
William Wernert
2021-02-22 15:44:29 -05:00
parent b00cc88801
commit 3e3c923ab9

View File

@@ -66,12 +66,11 @@ def find_minion_pillar() -> str:
result.append(os.path.join(root, f_minion_id)) result.append(os.path.join(root, f_minion_id))
if len(result) == 0: if len(result) == 0:
print_err('Could not find manager-type pillar (eval, standalone, manager, import.)') print_err('Could not find manager-type pillar (eval, standalone, manager, import). Are you running this script on the manager?')
print_err('Are you running this script on the manager?')
sys.exit(3) sys.exit(3)
elif len(result) > 1: elif len(result) > 1:
res_str = ', '.join(f'\"{result}\"') res_str = ', '.join(f'\"{result}\"')
print_err('(This should not happen, the system is in an error state if you see this message.)') print_err('(This should not happen, the system is in an error state if you see this message.)\n')
print_err('More than one manager-type pillar exists, minion id\'s listed below:') print_err('More than one manager-type pillar exists, minion id\'s listed below:')
print_err(f' {res_str}') print_err(f' {res_str}')
sys.exit(3) sys.exit(3)