summaryrefslogtreecommitdiff
path: root/glanceclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-18 17:04:57 +0000
committerGerrit Code Review <review@openstack.org>2016-04-18 17:04:57 +0000
commit12e92558e50d0aa200d2ca0f98a7110e0adce922 (patch)
treee1a20f59370af9de196a362ac0cee70cf6d209e9 /glanceclient/shell.py
parentcad0245885edc63de74b122541bd287d9c74af08 (diff)
parentd0ec3a7ebb6add2e96c4a06231939baf56e2139a (diff)
downloadpython-glanceclient-12e92558e50d0aa200d2ca0f98a7110e0adce922.tar.gz
Merge "Re-enable stacktracing when --debug is used"
Diffstat (limited to 'glanceclient/shell.py')
-rwxr-xr-xglanceclient/shell.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/glanceclient/shell.py b/glanceclient/shell.py
index 1a5f20f..2a77b69 100755
--- a/glanceclient/shell.py
+++ b/glanceclient/shell.py
@@ -490,18 +490,12 @@ class OpenStackImagesShell(object):
try:
return self.get_subcommand_parser(api_version)
except ImportError as e:
- if options.debug:
- traceback.print_exc()
if not str(e):
# Add a generic import error message if the raised
# ImportError has none.
raise ImportError('Unable to import module. Re-run '
'with --debug for more info.')
raise
- except Exception:
- if options.debug:
- traceback.print_exc()
- raise
# Parse args once to find version
@@ -603,12 +597,6 @@ class OpenStackImagesShell(object):
args.func(client, args)
except exc.Unauthorized:
raise exc.CommandError("Invalid OpenStack Identity credentials.")
- except Exception:
- # NOTE(kragniz) Print any exceptions raised to stderr if the
- # --debug flag is set
- if args.debug:
- traceback.print_exc()
- raise
finally:
if profile:
trace_id = osprofiler_profiler.get().get_base_id()
@@ -679,4 +667,6 @@ def main():
except KeyboardInterrupt:
utils.exit('... terminating glance client', exit_code=130)
except Exception as e:
+ if utils.debug_enabled(argv) is True:
+ traceback.print_exc()
utils.exit(encodeutils.exception_to_unicode(e))