diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-09-16 14:33:51 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-09-16 14:33:52 +0000 |
commit | 9fa62e378e1029db6ef2bea3a8cedf88c93c4f71 (patch) | |
tree | cb1c90b13c032c4f10daf2ccdfdeec1c3483f8ec | |
parent | ba19a534b7576846d542f9c6a4d6769253c603e8 (diff) | |
parent | 4d6b94a6794c0cc6ae35e550d23323820881eec7 (diff) | |
download | python-glanceclient-9fa62e378e1029db6ef2bea3a8cedf88c93c4f71.tar.gz |
Merge "Print traceback to stderr if --debug is set"
-rw-r--r-- | glanceclient/shell.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/glanceclient/shell.py b/glanceclient/shell.py index 2640ef5..92de22e 100644 --- a/glanceclient/shell.py +++ b/glanceclient/shell.py @@ -26,6 +26,7 @@ import logging import os from os.path import expanduser import sys +import traceback import six.moves.urllib.parse as urlparse @@ -589,6 +590,12 @@ 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() |