From: rick.chen Date: Tue, 23 Feb 2016 09:39:49 +0000 (+0800) Subject: Correct iscsi lun type X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=85e9eae97948b0967a6f33cfb93e44e7569d8106;p=openstack-build%2Fcinder-build.git Correct iscsi lun type Correct iscsi assignment responsed lun type from string to int. Change-Id: I68abad28aaed6d1ebf63de5c1d817644d03ef5c8 Closes-Bug: #1548711 --- diff --git a/cinder/tests/unit/test_prophetstor_dpl.py b/cinder/tests/unit/test_prophetstor_dpl.py index fee5e5464..ba7d723e8 100644 --- a/cinder/tests/unit/test_prophetstor_dpl.py +++ b/cinder/tests/unit/test_prophetstor_dpl.py @@ -622,7 +622,7 @@ class TestProphetStorDPLDriver(test.TestCase): res = self.dpldriver.initialize_connection(DATA_IN_VOLUME, DATA_IN_CONNECTOR) self.assertEqual('iscsi', res['driver_volume_type']) - self.assertEqual('101', res['data']['target_lun']) + self.assertEqual(101, res['data']['target_lun']) self.assertTrue(res['data']['target_discovered']) self.assertEqual('172.31.1.210:3260', res['data']['target_portal']) self.assertEqual( diff --git a/cinder/volume/drivers/prophetstor/dpl_iscsi.py b/cinder/volume/drivers/prophetstor/dpl_iscsi.py index ed6eb5061..176569d95 100644 --- a/cinder/volume/drivers/prophetstor/dpl_iscsi.py +++ b/cinder/volume/drivers/prophetstor/dpl_iscsi.py @@ -82,7 +82,7 @@ class DPLISCSIDriver(dplcommon.DPLCOMMONDriver, properties['target_portal'] = tgportal break properties['target_lun'] = \ - assign[connector['initiator'].lower()] + int(assign[connector['initiator'].lower()]) break if properties['target_portal'] != '': @@ -96,7 +96,7 @@ class DPLISCSIDriver(dplcommon.DPLCOMMONDriver, if properties['target_portal'] != '': properties['target_lun'] = \ - tgInfo['logical_unit_number'] + int(tgInfo['logical_unit_number']) properties['target_iqn'] = \ tgInfo['target_identifier'] break