Change in vdsm[master]: vdscli: map invocation params to dictionary

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Mon Aug 31 08:35:07 UTC 2015


Piotr Kliczewski has posted comments on this change.

Change subject: vdscli: map invocation params to dictionary
......................................................................


Patch Set 2: Verified-1

(3 comments)

https://gerrit.ovirt.org/#/c/45429/2/lib/vdsm/jsonrpcvdscli.py
File lib/vdsm/jsonrpcvdscli.py:

Line 27: from yajsonrpc import \
Line 28:     JsonRpcRequest, \
Line 29:     JsonRpcNoResponseError
Line 30: 
Line 31: from rpc import vdsmapi
This import is wrong according to what we do in spec file in this patch set.
Line 32: from vdsm import response
Line 33: from .config import config
Line 34: 
Line 35: 


Line 62:         self._vapi = vdsmapi.get_api()
Line 63:         self._client = client
Line 64:         self._compat = compat
Line 65: 
Line 66:     def prepare_args(self, className, methodName, args, kwargs):
> /s/prepare_args/_prepare_args
Done
Line 67:         sym = self._vapi['commands'][className][methodName]
Line 68:         allargs = sym.get('data', {}).keys()
Line 69:         allargs = [arg[1:] if arg.startswith('*') else arg for arg in allargs]
Line 70:         params = dict(zip(allargs, args))


Line 66:     def prepare_args(self, className, methodName, args, kwargs):
Line 67:         sym = self._vapi['commands'][className][methodName]
Line 68:         allargs = sym.get('data', {}).keys()
Line 69:         allargs = [arg[1:] if arg.startswith('*') else arg for arg in allargs]
Line 70:         params = dict(zip(allargs, args))
> allargs is constructed from keys that are from a regular dictionary. not an
Good point, we need to use orederd dict.
Line 71:         params.update(kwargs)
Line 72:         return params
Line 73: 
Line 74:     def _callMethod(self, methodName, *args, **kwargs):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibac6eab3c519becb29d2b3551111d671bbb79df5
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.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