Merge "[cli] do not sort results of tasks"

This commit is contained in:
Jenkins 2016-11-15 10:38:17 +00:00 committed by Gerrit Code Review
commit b56ecbda90
4 changed files with 4 additions and 4 deletions

View File

@ -477,7 +477,7 @@ class TaskCommands(object):
"full_duration": x["data"]["full_duration"]}
for x in task.get_results()]
print(json.dumps(results, sort_keys=True, indent=4))
print(json.dumps(results, sort_keys=False, indent=4))
@cliutils.args("--deployment", dest="deployment", type=str,
metavar="<uuid>", required=False,

View File

@ -76,7 +76,7 @@ class FileExporter(exporter.Exporter):
if self.type == "json":
if task_results:
res = json.dumps(task_results, sort_keys=True, indent=4)
res = json.dumps(task_results, sort_keys=False, indent=4)
LOG.debug("Got the task %s results." % uuid)
else:
msg = ("Task %s results would be available when it will "

View File

@ -405,7 +405,7 @@ class TaskCommandsTestCase(test.TestCase):
self.assertEqual(1, mock_json_dumps.call_count)
self.assertEqual(1, len(mock_json_dumps.call_args[0]))
self.assertSequenceEqual(result, mock_json_dumps.call_args[0][0])
self.assertEqual({"sort_keys": True, "indent": 4},
self.assertEqual({"sort_keys": False, "indent": 4},
mock_json_dumps.call_args[1])
mock_task_get.assert_called_once_with(task_id)

View File

@ -68,7 +68,7 @@ class FileExporterTestCase(test.TestCase):
"sla": "baz_sla"
}
]
mock_dumps.assert_called_once_with(expected_dict, sort_keys=True,
mock_dumps.assert_called_once_with(expected_dict, sort_keys=False,
indent=4)
@mock.patch("rally.api.Task.get")