Use utils.exit rather than print+sys.exit
This replaces the use of a pattern along the lines of
print(error message)
sys.exit(1)
in a couple of place in the shell. utils.exit does much the same job,
but outputs to stderr.
Change-Id: I1d3b52e0685772c10aa806a8f208eb6dd7a0e7ef
This commit is contained in:
@@ -697,8 +697,6 @@ def main():
|
||||
try:
|
||||
OpenStackImagesShell().main(map(encodeutils.safe_decode, sys.argv[1:]))
|
||||
except KeyboardInterrupt:
|
||||
print('... terminating glance client', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
utils.exit('... terminating glance client')
|
||||
except Exception as e:
|
||||
print(utils.exception_to_str(e), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
utils.exit(utils.exception_to_str(e))
|
||||
|
||||
Reference in New Issue
Block a user