From: Victor Stinner <vstinner@redhat.com>
Date: Mon, 9 Nov 2015 11:54:16 +0000 (+0100)
Subject: Port EMC VMAX to Python 3
X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3a5cf111565e659326d936e8eb24e4c9050b5270;p=openstack-build%2Fcinder-build.git

Port EMC VMAX to Python 3

* Fix EMCVMAXMasking._get_storage_group_from_masking_view_instance():
  replace "if groups[0] > 0:" with "if len(groups):"
* tests-py3.txt: add cinder.tests.unit.test_emc_vmax

Partial-Implements: blueprint cinder-python3
Change-Id: I0f6be3cc0873efe683d39c4c70e19d0d0b79beb8
---

diff --git a/cinder/volume/drivers/emc/emc_vmax_masking.py b/cinder/volume/drivers/emc/emc_vmax_masking.py
index f62a141ee..b3b2b98b7 100644
--- a/cinder/volume/drivers/emc/emc_vmax_masking.py
+++ b/cinder/volume/drivers/emc/emc_vmax_masking.py
@@ -1096,7 +1096,7 @@ class EMCVMAXMasking(object):
         groups = conn.AssociatorNames(
             maskingViewInstance,
             ResultClass='CIM_DeviceMaskingGroup')
-        if groups[0] > 0:
+        if len(groups) > 0:
             foundStorageGroupInstanceName = groups[0]
 
         return foundStorageGroupInstanceName
diff --git a/tests-py3.txt b/tests-py3.txt
index 6426844c9..727543200 100644
--- a/tests-py3.txt
+++ b/tests-py3.txt
@@ -56,6 +56,7 @@ cinder.tests.unit.test_dellsc
 cinder.tests.unit.test_dellscapi
 cinder.tests.unit.test_dothill
 cinder.tests.unit.test_drbdmanagedrv
+cinder.tests.unit.test_emc_vmax
 cinder.tests.unit.test_emc_vnxdirect
 cinder.tests.unit.test_emc_xtremio
 cinder.tests.unit.test_eqlx