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
This commit is contained in:
Rakesh H S 2014-09-10 19:56:37 +05:30
parent f826bd612e
commit ec44d2a49e
1 changed files with 3 additions and 0 deletions

View File

@ -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