Change in vdsm[ovirt-3.5]: API: onlyUUID should affect only short status

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/38867

to review the following change.

Change subject: API: onlyUUID should affect only short status
......................................................................

API: onlyUUID should affect only short status

this patch makes the 'onlyUUID' parameter take effect only
if 'fullStatus' equals False (short status was asked).

depending on 'fullStatus' boolean parameter, the getVMList API can
return either full or short VM status.
Due to a bug originally introduced before 3.5.0, short status
was incorrectly produced as list(UUIDs), but it is meant to be
a list(dict(vmId:UUID, status:vmStatus), )

The 'onlyUUID' parameter was added to preserve
backward compatibility with early Engines 3.5.x, but it is meant
to fix short status (fullStatus=False), and should not always affect
output.

Instead, the current code always produces short and broken status
if 'onlyUUID' equals True, with the side effect that also fullStatus
is affected.

Bug-Url: https://bugzilla.redhat.com/1196327
Related-To: https://bugzilla.redhat.com/1196735
Change-Id: Id05a1bb92100023e8a96ee6f13daa8eedd233ff6
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/38679
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/API.py
M vdsm/rpc/Bridge.py
M vdsm/rpc/vdsmapi-schema.json
3 files changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/38867/1

diff --git a/vdsm/API.py b/vdsm/API.py
index bb750ec..c38f231 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1378,7 +1378,7 @@
         vmlist = [reportedStatus(v, fullStatus)
                   for v in self._cif.vmContainer.values()
                   if not vmSet or v.id in vmSet]
-        if onlyUUID:
+        if not fullStatus and onlyUUID:
             # BZ 1196735: api backward compatibility issue
             # REQUIRED_FOR: engine-3.5.0 only
             vmlist = [v['vmId'] for v in vmlist]
diff --git a/vdsm/rpc/Bridge.py b/vdsm/rpc/Bridge.py
index 47ae94c..c964741 100644
--- a/vdsm/rpc/Bridge.py
+++ b/vdsm/rpc/Bridge.py
@@ -347,7 +347,7 @@
     pass arguments to get verbose information for only this one VM.
     """
     vmId = api._UUID
-    return API.Global().getVMList(True, [vmId])
+    return API.Global().getVMList(True, [vmId], False)
 
 
 def VM_getInfo_Ret(ret):
diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index 7a469e4..d63cf6c 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -3480,9 +3480,12 @@
 #
 # @vmList:      #optional Filter the results by a list of UUIDs
 #
-# @onlyUUID:    #optional determines whether we need short of full status
-#               This parmeter is provided to keep backward compatibility
-#               with engine-3.5.0
+# @onlyUUID:    #optional Control the Short Status format, and
+#               has no effect if on Full Status (fullStatus=True).
+#               if True, the return value is a list of UUIDs.
+#               if False, the return value is a list of ShortStatus.
+#               This parameter is provided for backward
+#               compatibility with engine-3.5.0.
 #
 # Returns:
 # A list of VM UUIDs


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id05a1bb92100023e8a96ee6f13daa8eedd233ff6
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