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

danken at redhat.com danken at redhat.com
Tue Nov 3 10:33:25 UTC 2015


Dan Kenigsberg has submitted this change and it was merged.

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


vdscli: map invocation params to dictionary

We need to be more flexible with parameters provided during execution of
vdscli methods. Now we use api schema to name all the params so we can
match them properly on the server side.

With this change we can call vdscli methods as regular method and do
mapping behind the scene.

Code used for xmlrpc looked like:

self.vdscli.addNetwork(bridge,
                       *self._get_net_args(vlan, bond, nics, opts))

In above case we are required to prepare named params as array.

Now we can call it:

self.vdscli.addNetwork(bridge,
                       vlan=vlan, bond=bond, nics=nics, opts=opts)

as well as we can provide only optional params as we want.

This is first step which enable us to provide client side schema
validation.

It is required to extract schema files from jsonrpc rpm due to
dependency needed for python rpm. Now we make schema rpm required for
jsonrpc and python rpm.

Change-Id: Ibac6eab3c519becb29d2b3551111d671bbb79df5
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
Reviewed-on: https://gerrit.ovirt.org/45429
Reviewed-by: Yeela Kaplan <ykaplan at redhat.com>
Tested-by: Yeela Kaplan <ykaplan at redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/jsonrpcvdscli.py
1 file changed, 17 insertions(+), 2 deletions(-)

Approvals:
  Piotr Kliczewski: Verified
  Yeela Kaplan: Verified; Looks good to me, but someone else must approve
  Yaniv Bronhaim: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibac6eab3c519becb29d2b3551111d671bbb79df5
Gerrit-PatchSet: 13
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: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
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


More information about the vdsm-patches mailing list