Change in vdsm[master]: jsonrpcvdscli: Arrays can be returned from client call
mlibra at redhat.com
mlibra at redhat.com
Fri Feb 12 07:44:26 UTC 2016
Marek Libra has uploaded a new change for review.
Change subject: jsonrpcvdscli: Arrays can be returned from client call
......................................................................
jsonrpcvdscli: Arrays can be returned from client call
Only a dict response was expected from client method call
in jsonrpcvdscli before this patch.
With this patch, the non-dict (i.e. arrays) responses are wraped
in a dict 'items', so calls like getAllVmStats will not fail.
Change-Id: Iff22f6d75e9ff3400d1a2a2f64de5c121192e2f2
Signed-off-by: Marek Libra <mlibra at redhat.com>
---
M lib/vdsm/jsonrpcvdscli.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/53452/1
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 3d3b31d..7ab6403 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -113,7 +113,10 @@
if resp.result and resp.result is not True:
# None is translated to True inside our JSONRPC implementation
- return response.success(**resp.result)
+ if isinstance(resp.result, dict):
+ return response.success(**resp.result)
+ else:
+ return response.success(items=resp.result)
return response.success()
--
To view, visit https://gerrit.ovirt.org/53452
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff22f6d75e9ff3400d1a2a2f64de5c121192e2f2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marek Libra <mlibra at redhat.com>
More information about the vdsm-patches
mailing list