From: abhiram moturi Date: Thu, 28 Jan 2016 20:16:08 +0000 (+0000) Subject: Zfssaiscsi driver should return target_lun as int X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8f70411e411f322b58841b7e1c72ed0f83539aad;p=openstack-build%2Fcinder-build.git Zfssaiscsi driver should return target_lun as int 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 --- diff --git a/cinder/tests/unit/test_zfssa.py b/cinder/tests/unit/test_zfssa.py index 83709c493..5e43cbeea 100644 --- a/cinder/tests/unit/test_zfssa.py +++ b/cinder/tests/unit/test_zfssa.py @@ -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, '') diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index a90d71def..44a2a162c 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/cinder/volume/drivers/zfssa/zfssaiscsi.py @@ -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: