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

@ -126,6 +126,7 @@ be used to access the machine.
import os
import re
import argparse
import sys
from time import time
import sys
import ConfigParser
@ -191,9 +192,8 @@ except ImportError:
try:
import consul
except ImportError as e:
print("""failed=True msg='python-consul required for this module. see
http://python-consul.readthedocs.org/en/latest/#installation'""")
sys.exit(1)
sys.exit("""failed=True msg='python-consul required for this module.
See http://python-consul.readthedocs.org/en/latest/#installation'""")
from six import iteritems