Change in vdsm[master]: jsonrpc: handle timeout in callMethod

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Thu Jul 16 11:47:55 UTC 2015


Piotr Kliczewski has posted comments on this change.

Change subject: jsonrpc: handle timeout in callMethod
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/43167/3/lib/yajsonrpc/__init__.py
File lib/yajsonrpc/__init__.py:

Line 330:     def callMethod(self, methodName, params=[], rid=None):
Line 331:         responses = self.call(JsonRpcRequest(methodName, params, rid))
Line 332:         if not responses:
Line 333:             raise JsonRpcNoResponseError(methodName)
Line 334:         response = responses[0]
> Will update
I gave it more thought and I can see that it is not possible to implement as you suggest. call always gives us list of responses no matter whether the is one or more.

The api is prepared for batch processing but this specific method calls one verb so we expect maximum 1 response so 
we need to have responses[0].

I will update this code to make it more clear.
Line 335:         if response.error:
Line 336:             raise JsonRpcError(response.error['code'],
Line 337:                                response.error['message'])
Line 338: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I28dd33c9ff64962747b5592f9e373d3f81112186
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list