]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix HNAS iSCSI driver attachment
authorAdriano Rosso <adriano.rosso@fit-tecnologia.org.br>
Wed, 24 Feb 2016 13:13:38 +0000 (10:13 -0300)
committerAdriano Rosso <adriano.rosso@fit-tecnologia.org.br>
Wed, 24 Feb 2016 17:40:45 +0000 (14:40 -0300)
Currently, the HNAS iSCSI driver returns the logical unit number
related to the iSCSI target as a string while initializing the
connection.
This is breaking the attachment feature because os-brick expects
a numeric type.
This patch converts the LUN from string to int in order to solve
this problem.

Change-Id: I33958a93a6261b7d77e4becafa3efd5180e5d091
Closes-Bug: 1549375

cinder/tests/unit/test_hitachi_hnas_iscsi.py
cinder/volume/drivers/hitachi/hnas_iscsi.py

index 8a22ac86740d67b0c828f518ce41131b353e021a..b980bd508a66a4e03562fac8c4396795b1801f70 100644 (file)
@@ -415,6 +415,7 @@ class HNASiSCSIDriverTest(test.TestCase):
         vol = self._create_volume()
         conn = self.driver.initialize_connection(vol, connector)
         self.assertTrue('3260' in conn['data']['target_portal'])
+        self.assertTrue(type(conn['data']['target_lun']) is int)
 
         self.backend.add_iscsi_conn = mock.MagicMock()
         self.backend.add_iscsi_conn.side_effect = putils.ProcessExecutionError
index 43c10f3228a8800f30b1cd89140f20c3ce9acb3d..418e9450df366be9b82b32b766db4376e68a4bd4 100644 (file)
@@ -36,7 +36,7 @@ from cinder.volume.drivers.hitachi import hnas_backend
 from cinder.volume import utils
 from cinder.volume import volume_types
 
-HDS_HNAS_ISCSI_VERSION = '4.1.0'
+HDS_HNAS_ISCSI_VERSION = '4.3.0'
 
 LOG = logging.getLogger(__name__)
 
@@ -174,6 +174,8 @@ class HDSISCSIDriver(driver.ISCSIDriver):
     Version 3.3.0: Fixed iSCSI target limitation error
     Version 4.0.0: Added manage/unmanage features
     Version 4.1.0: Fixed XML parser checks on blank options
+    Version 4.2.0: Fixed SSH and cluster_admin_ip0 verification
+    Version 4.3.0: Fixed attachment with os-brick 1.0.0
     """
 
     def __init__(self, *args, **kwargs):
@@ -701,7 +703,7 @@ class HDSISCSIDriver(driver.ISCSIDriver):
         properties['target_discovered'] = False
         properties['target_portal'] = hnas_portal
         properties['target_iqn'] = fulliqn
-        properties['target_lun'] = hlun
+        properties['target_lun'] = int(hlun)
         properties['volume_id'] = volume['id']
         properties['auth_username'] = connector['initiator']