]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Zfssaiscsi driver should return target_lun as int
authorabhiram moturi <abhiram.moturi@oracle.com>
Thu, 28 Jan 2016 20:16:08 +0000 (20:16 +0000)
committerabhiram moturi <abhiram.moturi@oracle.com>
Fri, 29 Jan 2016 13:58:38 +0000 (13:58 +0000)
The zfssaiscsi driver in initialize_connection()
returns iscsi_properties['target_lun'] as a string.
Solaris version of openstack expects it to be an int
and fails for the driver. Also other drivers report
it as an int. So this will make the zfssaiscsi driver
more consistent with other drivers.

Change-Id: Ifdbca7a02e2d797af9149cd185c2fa5dce661f66
Closes-bug: #1538582

cinder/tests/unit/test_zfssa.py
cinder/volume/drivers/zfssa/zfssaiscsi.py

index 83709c493dc76515bbf33697a5d50e412c8e1a7a..5e43cbeea52656c6b36651d16f7335b0db8b8a29 100644 (file)
@@ -456,7 +456,7 @@ class TestZFSSAISCSIDriver(test.TestCase):
         self.assertEqual(lcfg.zfssa_target_portal,
                          props['data']['target_portal'])
         self.assertEqual(test_target_iqn, props['data']['target_iqn'])
-        self.assertEqual('0', props['data']['target_lun'])
+        self.assertEqual(0, props['data']['target_lun'])
         self.assertFalse(props['data']['target_discovered'])
 
         self.drv.terminate_connection(self.test_vol, '')
index a90d71def0996757988c43f88bddb22d07618c76..44a2a162c1561cc343d971f9007344e9e0037b13 100644 (file)
@@ -713,7 +713,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
         iscsi_properties['target_discovered'] = False
         iscsi_properties['target_portal'] = target_portal
         iscsi_properties['target_iqn'] = iqn
-        iscsi_properties['target_lun'] = lun
+        iscsi_properties['target_lun'] = int(lun)
         iscsi_properties['volume_id'] = volume['id']
 
         if 'provider_auth' in provider: