Trapping KeyboardInterrupt sooner.
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
This commit is contained in:
parent
c7c8e92e3c
commit
edf9ae5097
@ -440,9 +440,6 @@ class OpenStackImagesShell(object):
|
|||||||
args.func(client, args)
|
args.func(client, args)
|
||||||
except exc.Unauthorized:
|
except exc.Unauthorized:
|
||||||
raise exc.CommandError("Invalid OpenStack Identity credentials.")
|
raise exc.CommandError("Invalid OpenStack Identity credentials.")
|
||||||
except KeyboardInterrupt:
|
|
||||||
LOG.warn('... terminating glance client')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
@utils.arg('command', metavar='<subcommand>', nargs='?',
|
@utils.arg('command', metavar='<subcommand>', nargs='?',
|
||||||
help='Display help for <subcommand>')
|
help='Display help for <subcommand>')
|
||||||
@ -470,6 +467,9 @@ class HelpFormatter(argparse.HelpFormatter):
|
|||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
OpenStackImagesShell().main(map(utils.ensure_unicode, sys.argv[1:]))
|
OpenStackImagesShell().main(map(utils.ensure_unicode, sys.argv[1:]))
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print >> sys.stderr, '... terminating glance client'
|
||||||
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print >> sys.stderr, e
|
print >> sys.stderr, e
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user