From 3a5cf111565e659326d936e8eb24e4c9050b5270 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 9 Nov 2015 12:54:16 +0100 Subject: [PATCH] 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 --- cinder/volume/drivers/emc/emc_vmax_masking.py | 2 +- tests-py3.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- 2.45.2