Move osprofiler help message to the end of output
Follow the convention of how osprofiler result is displayed in console. Refer to implementation from nova See https://github.com/openstack/python-novaclient/blob/master/novaclient/shell.py#L873 Change-Id: I946d634413e13e1861631a171ae2a939dbb9faa5 Implements: blueprint osprofiler-support
This commit is contained in:
@@ -164,9 +164,7 @@ class VitrageShell(app.App):
|
|||||||
# signature and will skip initialization of osprofiler on the
|
# signature and will skip initialization of osprofiler on the
|
||||||
# server side.
|
# server side.
|
||||||
profiler.init(self.options.profile)
|
profiler.init(self.options.profile)
|
||||||
trace_id = profiler.get().get_base_id()
|
|
||||||
print("To display trace use the command:\n\n"
|
|
||||||
" osprofiler trace show --html %s " % trace_id)
|
|
||||||
auth_plugin = loading.load_auth_from_argparse_arguments(
|
auth_plugin = loading.load_auth_from_argparse_arguments(
|
||||||
self.options)
|
self.options)
|
||||||
session = loading.load_session_from_argparse_arguments(
|
session = loading.load_session_from_argparse_arguments(
|
||||||
@@ -242,7 +240,12 @@ def main(args=None):
|
|||||||
try:
|
try:
|
||||||
if args is None:
|
if args is None:
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
return VitrageShell().run(args)
|
result = VitrageShell().run(args)
|
||||||
|
if profiler and '--profile' in args:
|
||||||
|
trace_id = profiler.get().get_base_id()
|
||||||
|
print("To display trace use the command:\n\n"
|
||||||
|
" osprofiler trace show --html %s " % trace_id)
|
||||||
|
return result
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('... terminating vitrage client', file=sys.stderr)
|
print('... terminating vitrage client', file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Reference in New Issue
Block a user