From ec44d2a49e2bbc7e486bb1c3399376a61dee357e Mon Sep 17 00:00:00 2001 From: Rakesh H S Date: Wed, 10 Sep 2014 19:56:37 +0530 Subject: handles keyboard interrupt When an user intentionally provides an keyboard interrupt, heatclient throws the entire traceback on to the terminal instead of handling it. heatclient will now handle the keyboard interrrupt and provides an crisp message on to the terminal. Change-Id: Iaa30048e7948d7db1d5b256dd59ca2e0dd842df9 Closes-Bug: #1367283 --- heatclient/shell.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'heatclient/shell.py') diff --git a/heatclient/shell.py b/heatclient/shell.py index cd00ac6..432b70f 100644 --- a/heatclient/shell.py +++ b/heatclient/shell.py @@ -441,6 +441,9 @@ def main(args=None): args = sys.argv[1:] HeatShell().main(args) + except KeyboardInterrupt: + print("... terminating heat client", file=sys.stderr) + sys.exit(130) except Exception as e: if '--debug' in args or '-d' in args: raise -- cgit v1.2.1