]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Correct iscsi lun type
authorrick.chen <rick.chen@prophetstor.com>
Tue, 23 Feb 2016 09:39:49 +0000 (17:39 +0800)
committerrick.chen <rick.chen@prophetstor.com>
Tue, 23 Feb 2016 15:43:44 +0000 (23:43 +0800)
Correct iscsi assignment responsed lun type from string to int.

Change-Id: I68abad28aaed6d1ebf63de5c1d817644d03ef5c8
Closes-Bug: #1548711

cinder/tests/unit/test_prophetstor_dpl.py
cinder/volume/drivers/prophetstor/dpl_iscsi.py

index fee5e5464e7b1b3734f5330077dfb69b3b2b2997..ba7d723e899ee9eb9862e50b42e766bf6e8adb4a 100644 (file)
@@ -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(
index ed6eb50618743e82a6142e41a471b20e39186245..176569d95d8aeff85cd868bbb354849856d74144 100644 (file)
@@ -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