diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-04-18 17:04:57 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-04-18 17:04:57 +0000 |
commit | 12e92558e50d0aa200d2ca0f98a7110e0adce922 (patch) | |
tree | e1a20f59370af9de196a362ac0cee70cf6d209e9 /glanceclient/shell.py | |
parent | cad0245885edc63de74b122541bd287d9c74af08 (diff) | |
parent | d0ec3a7ebb6add2e96c4a06231939baf56e2139a (diff) | |
download | python-glanceclient-12e92558e50d0aa200d2ca0f98a7110e0adce922.tar.gz |
Merge "Re-enable stacktracing when --debug is used"
Diffstat (limited to 'glanceclient/shell.py')
-rwxr-xr-x | glanceclient/shell.py | 14 |
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)) |