Return 130 for keyboard interrupt

When keyboard interrupt is received by glanceclient, the return code as
of now is 1.

But since the client was terminated by an keyboard interrupt, the return
code should be 130. (http://tldp.org/LDP/abs/html/exitcodes.html)
It is useful when people are writing automation test cases and want to
validate based on the return code.

Change-Id: Ia70116ab6f0708a0ce6eeaed07c1e7a56e68c9f4
Closes-Bug: #1373231
This commit is contained in:
Rakesh H S
2014-09-25 11:19:31 +05:30
parent 869e6ace0e
commit 96ff6e46c4
3 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -697,6 +697,6 @@ def main():
try:
OpenStackImagesShell().main(map(encodeutils.safe_decode, sys.argv[1:]))
except KeyboardInterrupt:
utils.exit('... terminating glance client')
utils.exit('... terminating glance client', exit_code=130)
except Exception as e:
utils.exit(utils.exception_to_str(e))