summaryrefslogtreecommitdiff
path: root/glanceclient/common/utils.py
diff options
context:
space:
mode:
authorRakesh H S <rh-s@hp.com>2014-09-25 11:19:31 +0530
committerRakesh H S <rh-s@hp.com>2015-02-05 05:08:59 +0000
commit96ff6e46c4e5c476b42399d9df016a468b2e1b6d (patch)
tree0d19416e23e5ce4ca01afca6b44a72aa46473466 /glanceclient/common/utils.py
parent869e6ace0ebed70ba6fd73b0df7984b4d2cf0799 (diff)
downloadpython-glanceclient-96ff6e46c4e5c476b42399d9df016a468b2e1b6d.tar.gz
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
Diffstat (limited to 'glanceclient/common/utils.py')
-rw-r--r--glanceclient/common/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py
index 5841ffe..6d4529d 100644
--- a/glanceclient/common/utils.py
+++ b/glanceclient/common/utils.py
@@ -234,10 +234,10 @@ def import_versioned_module(version, submodule=None):
return importutils.import_module(module)
-def exit(msg=''):
+def exit(msg='', exit_code=1):
if msg:
print(encodeutils.safe_decode(msg), file=sys.stderr)
- sys.exit(1)
+ sys.exit(exit_code)
def save_image(data, path):