Skip to content

Commit

Permalink
Trapping KeyboardInterrupt sooner.
Browse files Browse the repository at this point in the history
Currently a KeyboardInterrupt can be triggered by the user while the
client is communicating with keystone.  This patch moves the trap
higher up in the stack.

Fixes bug: 1157905

Change-Id: I16889c2d97bc4694ab27c863c62c27333e264b60
  • Loading branch information
John Bresnahan committed Mar 20, 2013
1 parent c7c8e92 commit edf9ae5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glanceclient/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,6 @@ def main(self, argv):
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='<subcommand>', nargs='?',
help='Display help for <subcommand>')
Expand Down Expand Up @@ -470,6 +467,9 @@ def start_section(self, heading):
def main():
try:
OpenStackImagesShell().main(map(utils.ensure_unicode, sys.argv[1:]))
except KeyboardInterrupt:
print >> sys.stderr, '... terminating glance client'
sys.exit(1)
except Exception, e:
print >> sys.stderr, e
sys.exit(1)

0 comments on commit edf9ae5

Please sign in to comment.