Saggi Mizrahi has uploaded a new change for review.

Change subject: jsonrpc: add ability to get dictionary directly from 
JsonRpcRequest
......................................................................

jsonrpc: add ability to get dictionary directly from JsonRpcRequest

Change-Id: Ieb7edc48aa7d773b54db9d43e9f5460920e8ea50
Signed-off-by: Saggi Mizrahi <smizr...@redhat.com>
---
M lib/yajsonrpc/__init__.py
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/35254/1

diff --git a/lib/yajsonrpc/__init__.py b/lib/yajsonrpc/__init__.py
index 69be3c4..cb04e13 100644
--- a/lib/yajsonrpc/__init__.py
+++ b/lib/yajsonrpc/__init__.py
@@ -105,12 +105,16 @@
 
         return JsonRpcRequest(method, params, reqId)
 
-    def encode(self):
-        res = {'jsonrpc': '2.0',
-               'method': self.method,
-               'params': self.params,
-               'id': self.id}
+    def toDict(self):
+        return {
+            'jsonrpc': '2.0',
+            'method': self.method,
+            'params': self.params,
+            'id': self.id
+        }
 
+    def encode(self):
+        res = self.toDict()
         return json.dumps(res, 'utf-8')
 
     def isNotification(self):


-- 
To view, visit http://gerrit.ovirt.org/35254
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb7edc48aa7d773b54db9d43e9f5460920e8ea50
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizr...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to