From 1a3d40ccb4f532cad2ae0e1ad642ba56b0e2f707 Mon Sep 17 00:00:00 2001 From: John Bresnahan Date: Tue, 19 Feb 2013 11:58:54 -1000 Subject: [PATCH] Control C does not cancel the CLI cleanly When a user attempts to terminate the CLI with CTL+C a stack trace is printed to the screen. When downloading files the partial amount downloaded will not be cleaned up. In most cases the user redirects to stdout, thus this program cannot clean that up. Fixes Bug: 1130390 Change-Id: If9f8ffc72b422d5dbd5969eecde8904238dd8860 --- glanceclient/shell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glanceclient/shell.py b/glanceclient/shell.py index 4256b14..ecece3a 100644 --- a/glanceclient/shell.py +++ b/glanceclient/shell.py @@ -440,6 +440,9 @@ class OpenStackImagesShell(object): args.func(client, args) except exc.Unauthorized: raise exc.CommandError("Invalid OpenStack Identity credentials.") + except KeyboardInterrupt: + LOG.warn('... terminating glance client') + sys.exit(1) @utils.arg('command', metavar='', nargs='?', help='Display help for ')