Change in vdsm[ovirt-3.5]: API: getVMList: compatibity with internal clients

fromani at redhat.com fromani at redhat.com
Wed Mar 18 11:51:57 UTC 2015


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/38868

to review the following change.

Change subject: API: getVMList: compatibity with internal clients
......................................................................

API: getVMList: compatibity with internal clients

After the addition of the 'onlyUUID' parameter, the external
API of VDSM is now backward compatible:

- in XMLRPC, we always set explicitely onlyUUID=False, so no room for
  breakage
- in JSONRPC, we have Host_getVMList_Call (short status), on which
  * if onlyUUID is provided from the outside, we use it
    (works with Engine >= 3.5.1)
  * if onlyUUID is NOT given (Engine 3.5.0), we default as True,
    and doing so we preserve the backward compatibility
- in JSONRPC, in Host_getVMFullList_Call (full status), we use
  onlyUUID=False explicitely, so no issue hee

The internal API, however, changed behaviour.
Being the API internal, it doesn't usually need special care,
but this time we need, because MOM is a supported client of
this API.

With the current 'onlyUUID' defaults, clients of API.py
will get a list of UUIDs instead of a list of Short Status.

To fix this, and given the findings outlined in the above bullet points,
we just switch the default value of 'onlyUUID' to cover this use case.

Bug-Url: https://bugzilla.redhat.com/1196327
Related-To: https://bugzilla.redhat.com/1196735
Change-Id: I0560a262329f729716577b28aa78b177f0929121
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/38805
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/API.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/38868/1

diff --git a/vdsm/API.py b/vdsm/API.py
index c38f231..36fafe2 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1363,7 +1363,7 @@
         return dict(status=doneCode)
 
     # VM-related functions
-    def getVMList(self, fullStatus=False, vmList=(), onlyUUID=True):
+    def getVMList(self, fullStatus=False, vmList=(), onlyUUID=False):
         """ return a list of known VMs with full (or partial) config each """
 
         def reportedStatus(v, full):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0560a262329f729716577b28aa78b177f0929121
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list