From f45a282be0df1e786a76573e6e3f6fead3469956 Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Thu, 18 May 2017 20:51:32 +0200 Subject: [PATCH] restful: Output sub-commands more clearly Signed-off-by: Boris Ranto --- src/pybind/mgr/restful/module.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index 6e643e862b5..1f4949bcce5 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -155,19 +155,35 @@ class CommandsRequest(object): return { 'id': self.id, 'running': map( - lambda x: (x.command, x.outs, x.outb), + lambda x: { + 'command': x.command, + 'outs': x.outs, + 'outb': x.outb, + }, self.running ), 'finished': map( - lambda x: (x.command, x.outs, x.outb), + lambda x: { + 'command': x.command, + 'outs': x.outs, + 'outb': x.outb, + }, self.finished ), 'waiting': map( - lambda x: (x.command, x.outs, x.outb), + lambda x: { + 'command': x.command, + 'outs': x.outs, + 'outb': x.outb, + }, self.waiting ), 'failed': map( - lambda x: (x.command, x.outs, x.outb), + lambda x: { + 'command': x.command, + 'outs': x.outs, + 'outb': x.outb, + }, self.failed ), 'is_waiting': self.is_waiting(), -- 2.47.3