]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Port IBM flashsystem to Python 3
authorVictor Stinner <vstinner@redhat.com>
Wed, 7 Oct 2015 16:02:43 +0000 (18:02 +0200)
committerVictor Stinner <vstinner@redhat.com>
Thu, 8 Oct 2015 20:47:44 +0000 (22:47 +0200)
* 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
tests-py3.txt

index f8fa930dbf75bfe08bc4e4436007ab010ed1e5be..422b6bddc40d34b06604847f56bacf021190e919 100644 (file)
@@ -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 '
index d7a56090e0e953ad93b712c688269e4d89f07a09..b31aa6488b7f2b7cae01ae81cd77f4ba87318280 100644 (file)
@@ -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