Merge "Fix error message for invalid trace"

This commit is contained in:
Jenkins 2017-04-14 16:33:00 +00:00 committed by Gerrit Code Review
commit 1a86e4fbb4
2 changed files with 4 additions and 13 deletions

View File

@ -62,13 +62,8 @@ class TraceCommands(BaseCommand):
trace = engine.get_report(args.trace)
if not trace or not trace.get("children"):
msg = ("Trace with UUID %s not found. "
"There are 3 possible reasons: \n"
" 1) You are using not admin credentials\n"
" 2) You specified wrong trace id\n"
" 3) You specified wrong HMAC Key in original calling\n"
" 4) Ceilometer didn't enable profiler notification topic"
% args.trace)
msg = ("Trace with UUID %s not found. Please check the HMAC key "
"used in the command." % args.trace)
raise exc.CommandError(msg)
# NOTE(ayelistratov): Ceilometer translates datetime objects to

View File

@ -165,12 +165,8 @@ class ShellTestCase(test.TestCase):
def test_trace_show_trace_id_not_found(self, notifications, mock_get):
mock_get.return_value = notifications
msg = ("Trace with UUID %s not found. There are 3 possible reasons: \n"
" 1) You are using not admin credentials\n"
" 2) You specified wrong trace id\n"
" 3) You specified wrong HMAC Key in original calling\n"
" 4) Ceilometer didn't enable profiler notification topic"
% self.TRACE_ID)
msg = ("Trace with UUID %s not found. Please check the HMAC key "
"used in the command." % self.TRACE_ID)
self._test_with_command_error(self._trace_show_cmd(), msg)