]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pybind/snap_schedule: return valid json for 'status' command 40157/head
authorSébastien Han <seb@redhat.com>
Wed, 17 Mar 2021 10:08:09 +0000 (11:08 +0100)
committerSébastien Han <seb@redhat.com>
Mon, 26 Apr 2021 06:57:31 +0000 (08:57 +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>
src/pybind/mgr/snap_schedule/module.py

index ec4b30513cc17ba52976a4a9d529f432ce4ea155..a068b4ac31d8c9b6906ac19d6fe04deba4ed0d7e 100644 (file)
@@ -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')