]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
restful: Fix jsonification
authorBoris Ranto <branto@redhat.com>
Mon, 30 Oct 2017 14:43:38 +0000 (15:43 +0100)
committerKefu Chai <kchai@redhat.com>
Tue, 8 May 2018 05:10:46 +0000 (13:10 +0800)
The CommandsRequest.waiting is an array of arrays, not an array of
command results and so it cannot be represented that way. This commit
fixes that by outputting the array in json diretly.

Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit 7005c6c0f68d82776c11cdfdd1a56e06f27d5e66)

src/pybind/mgr/restful/module.py

index 6ce610b881f4d06d98ae0e25fca3e84721dfeb47..5125253e4667b246eff95d5a0e40a4933d662d52 100644 (file)
@@ -177,11 +177,10 @@ class CommandsRequest(object):
                 self.finished
             ),
             'waiting': map(
-                lambda x: {
-                    'command': x.command,
-                    'outs': x.outs,
-                    'outb': x.outb,
-                },
+                lambda x: map(
+                    lambda y: common.humanify_command(y),
+                    x
+                ),
                 self.waiting
             ),
             'failed': map(