Merge "Print traceback to stderr if --debug is set"
This commit is contained in:
@@ -26,6 +26,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
import sys
|
import sys
|
||||||
|
import traceback
|
||||||
|
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
@@ -589,6 +590,12 @@ 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 Exception:
|
||||||
|
#NOTE(kragniz) Print any exceptions raised to stderr if the --debug
|
||||||
|
# flag is set
|
||||||
|
if args.debug:
|
||||||
|
traceback.print_exc()
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
if profile:
|
if profile:
|
||||||
trace_id = osprofiler_profiler.get().get_base_id()
|
trace_id = osprofiler_profiler.get().get_base_id()
|
||||||
|
Reference in New Issue
Block a user