Francesco Romani has uploaded a new change for review.

Change subject: vdsm interface: improve getVmList usage
......................................................................

vdsm interface: improve getVmList usage

make the usage of getVmList slightly cleaner and more efficient

Change-Id: I3dcd15e5858aefd36ff3982460d13ec50a8ee717
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M mom/HypervisorInterfaces/vdsmInterface.py
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/26/41226/1

diff --git a/mom/HypervisorInterfaces/vdsmInterface.py 
b/mom/HypervisorInterfaces/vdsmInterface.py
index 02a73e2..785aaf3 100644
--- a/mom/HypervisorInterfaces/vdsmInterface.py
+++ b/mom/HypervisorInterfaces/vdsmInterface.py
@@ -77,10 +77,11 @@
         try:
             response = self.vdsm_api.getVMList()
             self._check_status(response)
-            vm_list = response['vmList']
-            for vm in vm_list:
-                if self._vmIsRunning(vm):
-                    vmIds.append(vm['vmId'])
+            vmIds = [
+                vm['vmId']
+                for vm in response['vmList']
+                if vm['status'] == 'Up'
+            ]
             self.logger.debug('VM List: %s', vmIds)
             return vmIds
         except vdsmException, e:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3dcd15e5858aefd36ff3982460d13ec50a8ee717
Gerrit-PatchSet: 1
Gerrit-Project: mom
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to