From 8f70411e411f322b58841b7e1c72ed0f83539aad Mon Sep 17 00:00:00 2001 From: abhiram moturi Date: Thu, 28 Jan 2016 20:16:08 +0000 Subject: [PATCH] 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 --- cinder/tests/unit/test_zfssa.py | 2 +- cinder/volume/drivers/zfssa/zfssaiscsi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: -- 2.45.2