Use sys.exit(msg) i/o print() and sys.exit() (#15465)

Any non-0 exits should be showing an error message
to stderr instead of to stdout.
This commit is contained in:
Adrian Likins 2016-08-23 11:09:23 -04:00 committed by Brian Coca
commit 57a911e098
10 changed files with 22 additions and 37 deletions

View file

@ -40,4 +40,4 @@ if len(sys.argv) == 2 and sys.argv[1] == '--list':
elif len(sys.argv) == 3 and sys.argv[1] == '--host':
print(json.dumps({'ansible_connection': 'zone'}))
else:
print("Need an argument, either --list or --host <host>")
sys.stderr.write("Need an argument, either --list or --host <host>\n")