From c54e225a2a0d6faa0da62dfbd239a26875b3ceaf Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 7 Oct 2015 18:02:43 +0200 Subject: [PATCH] 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 --- cinder/volume/drivers/ibm/flashsystem_common.py | 2 +- tests-py3.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- 2.45.2