diff options
author | Adrian Likins <alikins@redhat.com> | 2016-08-23 11:09:23 -0400 |
---|---|---|
committer | Brian Coca <bcoca@users.noreply.github.com> | 2016-08-23 11:09:23 -0400 |
commit | 57a911e098dacaa45812c70505f45fa8e80acf3f (patch) | |
tree | 08f93bb490b37937b859698d605d5cf04e6d3c67 /contrib/inventory/gce.py | |
parent | 76f9935634724118d316d2687876424a70882b8b (diff) | |
download | ansible-57a911e098dacaa45812c70505f45fa8e80acf3f.tar.gz |
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.
Diffstat (limited to 'contrib/inventory/gce.py')
-rwxr-xr-x | contrib/inventory/gce.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index ff2feeb1cc..d485616636 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -104,8 +104,7 @@ try: from libcloud.compute.providers import get_driver _ = Provider.GCE except: - print("GCE inventory script requires libcloud >= 0.13") - sys.exit(1) + sys.exit("GCE inventory script requires libcloud >= 0.13") class GceInventory(object): @@ -205,8 +204,7 @@ class GceInventory(object): if not secrets_path.endswith('secrets.py'): err = "Must specify libcloud secrets file as " err += "/absolute/path/to/secrets.py" - print(err) - sys.exit(1) + sys.exit(err) sys.path.append(os.path.dirname(secrets_path)) try: import secrets |