From: Victor Stinner Date: Wed, 7 Oct 2015 16:02:43 +0000 (+0200) Subject: Port IBM flashsystem to Python 3 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c54e225a2a0d6faa0da62dfbd239a26875b3ceaf;p=openstack-build%2Fcinder-build.git Port IBM flashsystem to Python 3 * Replace dict.keys()[0] with list(dict.keys())[0]. On Python 3, dict.keys() now returns a view which is not indexable. * tests-py3.txt: add cinder.tests.unit.test_ibm_flashsystem Partial-Implements: blueprint cinder-python3 Change-Id: Ic77145784acc8c88e77d50a5086019e69d15e6ff --- diff --git a/cinder/volume/drivers/ibm/flashsystem_common.py b/cinder/volume/drivers/ibm/flashsystem_common.py index f8fa930db..422b6bddc 100644 --- a/cinder/volume/drivers/ibm/flashsystem_common.py +++ b/cinder/volume/drivers/ibm/flashsystem_common.py @@ -819,7 +819,7 @@ class FlashSystemDriver(san.SanDriver): {'vdisk_name': vdisk_name}) return else: - host_name = mapping_data.keys()[0] + host_name = list(mapping_data.keys())[0] else: if host_name not in mapping_data: LOG.error(_LE('_unmap_vdisk_from_host: No mapping of volume ' diff --git a/tests-py3.txt b/tests-py3.txt index d7a56090e..b31aa6488 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -52,6 +52,7 @@ cinder.tests.unit.test_hp_xp_fc cinder.tests.unit.test_hplefthand cinder.tests.unit.test_huawei_drivers cinder.tests.unit.test_huawei_drivers_compatibility +cinder.tests.unit.test_ibm_flashsystem cinder.tests.unit.test_ibm_flashsystem_iscsi cinder.tests.unit.test_ibm_xiv_ds8k cinder.tests.unit.test_ibmnas