]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pybind/snap_schedule: return valid json for 'status' command 41044/head
authorSébastien Han <seb@redhat.com>
Wed, 17 Mar 2021 10:08:09 +0000 (11:08 +0100)
committerSébastien Han <seb@redhat.com>
Wed, 2 Jun 2021 13:56:03 +0000 (15:56 +0200)
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 <seb@redhat.com>
(cherry picked from commit bf115b49b93cec85ad4fe408d622e5d60d8fbd51)

src/pybind/mgr/snap_schedule/module.py

index 405fb895692bc5294ad6e9b42ac46d263fd7da93..701c1551e4f5d24b67032ba0de4aeb7bad741eb9 100644 (file)
@@ -73,7 +73,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')