From bf115b49b93cec85ad4fe408d622e5d60d8fbd51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Wed, 17 Mar 2021 11:08:09 +0100 Subject: [PATCH] mgr/pybind/snap_schedule: return valid json for 'status' command MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The status should return a valid list, prior to this path the code was only appending json blob next to each other resulting in an invalid json. Now the blobs will be enclosed properly so a valid list is returned. Signed-off-by: Sébastien Han --- src/pybind/mgr/snap_schedule/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/snap_schedule/module.py b/src/pybind/mgr/snap_schedule/module.py index ec4b30513cc..a068b4ac31d 100644 --- a/src/pybind/mgr/snap_schedule/module.py +++ b/src/pybind/mgr/snap_schedule/module.py @@ -81,7 +81,7 @@ class Module(MgrModule): return e.to_tuple() if format == 'json': json_report = ','.join([ret_sched.report_json() for ret_sched in ret_scheds]) - return 0, f'{json_report}', '' + return 0, f'[{json_report}]', '' return 0, '\n===\n'.join([ret_sched.report() for ret_sched in ret_scheds]), '' @CLIReadCommand('fs snap-schedule list') -- 2.39.5