Irit Goihman has uploaded a new change for review.

Change subject: jsonrpcvdscli: fix Host.getVMList command result
......................................................................

jsonrpcvdscli: fix Host.getVMList command result

Host.getVMList and Host.getFullVMList are similar commands that differ in
their verbosity level. Their result should be represented as a value inside
a dictionary with 'vmList' key. Instead of that, it was represented as
a list and during the creation of JsonRPCResponse it was re constructed
inside a dictionary holding the result inside 'items' key.

Change-Id: I28f39417b0006957670bb6ccbdb673f2e0f89043
Signed-off-by: Irit Goihman <igoih...@redhat.com>
---
M lib/vdsm/rpc/Bridge.py
1 file changed, 19 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/63408/1

diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index bd180e0..79c4bc0 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -270,6 +270,15 @@
     return API.Global().getVMList(False, vmList, onlyUUID)
 
 
+def Host_getVMList_Ret(ret):
+    """
+    The returned dictionary doesn't separate the vmList from the status code
+    so we need to rebuild the result.
+    """
+    del ret['status']
+    return ret
+
+
 def Host_getVMFullList_Call(api, args):
     """
     This call is interested in returning full status.
@@ -351,8 +360,16 @@
     'Host_getStorageDomains': {'ret': 'domlist'},
     'Host_getStorageRepoStats': {'ret': Host_getStorageRepoStats_Ret},
     'Host_hostdevListByCaps': {'ret': 'deviceList'},
-    'Host_getVMList': {'call': Host_getVMList_Call, 'ret': 'vmList'},
-    'Host_getVMFullList': {'call': Host_getVMFullList_Call, 'ret': 'vmList'},
+    'Host_getVMList':
+    {
+        'call': Host_getVMList_Call,
+        'ret': Host_getVMList_Ret
+    },
+    'Host_getVMFullList':
+    {
+        'call': Host_getVMFullList_Call,
+        'ret': Host_getVMList_Ret
+    },
     'Host_getAllVmStats': {'ret': 'statsList'},
     'Host_setupNetworks': {'ret': 'status'},
     'Host_setKsmTune': {'ret': 'status'},


-- 
To view, visit https://gerrit.ovirt.org/63408
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28f39417b0006957670bb6ccbdb673f2e0f89043
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoih...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to