]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Force target_lun to be int type to make os-brick happy
authorRichard Hedlind <richard.hedlind@x-io.com>
Wed, 24 Feb 2016 00:51:01 +0000 (17:51 -0700)
committerRichard Hedlind <richard.hedlind@x-io.com>
Wed, 24 Feb 2016 00:59:28 +0000 (17:59 -0700)
The X-IO driver was returning the target_lun field as a string
from initialize_connection. It has to be an int to not cause
breakage later on.

Change-Id: I41c91b78753a2007c243ed30731f0a0cd92e68b5
Closes-Bug: #1549048

cinder/tests/unit/test_xio.py
cinder/volume/drivers/xio.py

index e7f5d2bb4eb98c5f57e389b528a18fb9054ba8ba..3ebb0825aba25b2d7790be86f4e834bbf89c6377 100644 (file)
@@ -864,7 +864,7 @@ class XIOISEDriverTestCase(object):
         else:
             protocol = 'fibre_channel'
         exp_result = {'vendor_name': "X-IO",
-                      'driver_version': "1.1.3",
+                      'driver_version': "1.1.4",
                       'volume_backend_name': backend_name,
                       'reserved_percentage': 0,
                       'total_capacity_gb': 100,
@@ -1038,14 +1038,14 @@ class XIOISEDriverTestCase(object):
         exp_result = {}
         if self.configuration.ise_protocol == 'iscsi':
             exp_result = {"driver_volume_type": "iscsi",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '1',
                                    "target_discovered": False,
                                    "target_iqn": ISE_IQN,
                                    "target_portal": ISE_ISCSI_IP1 + ":3260"}}
         elif self.configuration.ise_protocol == 'fibre_channel':
             exp_result = {"driver_volume_type": "fibre_channel",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '1',
                                    "target_discovered": True,
                                    "initiator_target_map": ISE_INIT_TARGET_MAP,
@@ -1067,14 +1067,14 @@ class XIOISEDriverTestCase(object):
         exp_result = {}
         if self.configuration.ise_protocol == 'iscsi':
             exp_result = {"driver_volume_type": "iscsi",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '1',
                                    "target_discovered": False,
                                    "target_iqn": ISE_IQN,
                                    "target_portal": ISE_ISCSI_IP1 + ":3260"}}
         elif self.configuration.ise_protocol == 'fibre_channel':
             exp_result = {"driver_volume_type": "fibre_channel",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '1',
                                    "target_discovered": True,
                                    "initiator_target_map": ISE_INIT_TARGET_MAP,
@@ -1096,7 +1096,7 @@ class XIOISEDriverTestCase(object):
         exp_result = {}
         if self.configuration.ise_protocol == 'iscsi':
             exp_result = {"driver_volume_type": "iscsi",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '2',
                                    "target_discovered": False,
                                    "target_iqn": ISE_IQN,
@@ -1106,7 +1106,7 @@ class XIOISEDriverTestCase(object):
                                    'auth_password': 'abc'}}
         elif self.configuration.ise_protocol == 'fibre_channel':
             exp_result = {"driver_volume_type": "fibre_channel",
-                          "data": {"target_lun": '1',
+                          "data": {"target_lun": 1,
                                    "volume_id": '2',
                                    "target_discovered": True,
                                    "initiator_target_map": ISE_INIT_TARGET_MAP,
index 6c6d9df2b5366b5a375831cea53a34666978c794..ecf36d4f17c1bd7d4d76b798629a0098217c80f0 100644 (file)
@@ -63,7 +63,7 @@ def RaiseXIODriverException():
 
 class XIOISEDriver(object):
 
-    VERSION = '1.1.3'
+    VERSION = '1.1.4'
 
     # Version   Changes
     # 1.0.0     Base driver
@@ -71,6 +71,7 @@ class XIOISEDriver(object):
     # 1.1.1     Fix retry loop (Bug 1429283)
     # 1.1.2     Fix host object deletion (Bug 1433450).
     # 1.1.3     Wait for volume/snapshot to be deleted.
+    # 1.1.4     Force target_lun to be int (Bug 1549048)
 
     def __init__(self, *args, **kwargs):
         super(XIOISEDriver, self).__init__()
@@ -1343,7 +1344,7 @@ class XIOISEDriver(object):
         target_lun = self._present_volume(volume, host['name'], target_lun)
         # Fill in target information.
         data = {}
-        data['target_lun'] = target_lun
+        data['target_lun'] = int(target_lun)
         data['volume_id'] = volume['id']
         return data