]> git-server-git.apps.pok.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)
committerBoris Ranto <branto@redhat.com>
Tue, 31 Oct 2017 11:51:45 +0000 (12:51 +0100)
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>
src/pybind/mgr/restful/module.py

index 1bb6f6e0fb354ce2690edee4458fbee2b66772a3..acc7a1e69d1039fdb6f6fcfaa3032846f13becbd 100644 (file)
@@ -176,11 +176,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(