Fix for Tegile driver failing to establish volume connection
LUN number reported should be integer, but it is returned as a string by the backend storage. This change would help handle the case. Change-Id: I600cb94d646fabbb053f390dd9b3db489ebedfc8 Closes-Bug: #1630035
This commit is contained in:
parent
3151fdfdd7
commit
d63b455b97
|
@ -98,12 +98,12 @@ class FakeTegileService(object):
|
|||
elif method is 'getVolumeSizeinGB':
|
||||
return 25
|
||||
elif method is 'getISCSIMappingForVolume':
|
||||
return {'target_lun': '27',
|
||||
return {'target_lun': 27,
|
||||
'target_iqn': 'iqn.2012-02.com.tegile:openstack-cobalt',
|
||||
'target_portal': '10.68.103.106:3260'
|
||||
}
|
||||
elif method is 'getFCPortsForVolume':
|
||||
return {'target_lun': '12',
|
||||
return {'target_lun': 12,
|
||||
'initiator_target_map':
|
||||
'{"21000024ff59bb6e":["21000024ff578701",],'
|
||||
'"21000024ff59bb6f":["21000024ff578700",],}',
|
||||
|
@ -363,7 +363,7 @@ class TegileISCSIDriverTestCase(test.TestCase):
|
|||
'auth_username': 'fake',
|
||||
'target_iqn': 'iqn.2012-02.'
|
||||
'com.tegile:openstack-cobalt',
|
||||
'target_lun': '27',
|
||||
'target_lun': 27,
|
||||
'target_portal': '10.68.103.106:3260',
|
||||
'volume_id': (
|
||||
'a24c2ee8-525a-4406-8ccd-8d38688f8e9e',)},
|
||||
|
@ -395,7 +395,7 @@ class TegileFCDriverTestCase(test.TestCase):
|
|||
['21000024ff578700']
|
||||
},
|
||||
'target_discovered': False,
|
||||
'target_lun': '12',
|
||||
'target_lun': 12,
|
||||
'target_wwn':
|
||||
['21000024ff578700',
|
||||
'21000024ff578701']},
|
||||
|
|
|
@ -526,7 +526,7 @@ class TegileISCSIDriver(TegileIntelliFlashVolumeDriver, san.SanISCSIDriver):
|
|||
connection_data = dict()
|
||||
connection_data['target_portal'] = target_portal
|
||||
connection_data['target_iqn'] = target_iqn
|
||||
connection_data['target_lun'] = target_lun
|
||||
connection_data['target_lun'] = int(target_lun)
|
||||
connection_data['target_discovered'] = False,
|
||||
connection_data['volume_id'] = volume['id'],
|
||||
connection_data['discard'] = False
|
||||
|
@ -570,7 +570,7 @@ class TegileISCSIDriver(TegileIntelliFlashVolumeDriver, san.SanISCSIDriver):
|
|||
params=params)
|
||||
target_portal = mapping_info['target_portal']
|
||||
target_iqn = mapping_info['target_iqn']
|
||||
target_lun = mapping_info['target_lun']
|
||||
target_lun = int(mapping_info['target_lun'])
|
||||
|
||||
provider_location = '%s %s %s' % (target_portal,
|
||||
target_iqn,
|
||||
|
@ -623,7 +623,7 @@ class TegileFCDriver(TegileIntelliFlashVolumeDriver,
|
|||
'data': {
|
||||
'encrypted': False,
|
||||
'target_discovered': False,
|
||||
'target_lun': target_info['target_lun'],
|
||||
'target_lun': int(target_info['target_lun']),
|
||||
'target_wwn': ast.literal_eval(target_info['target_wwn']),
|
||||
'initiator_target_map': ast.literal_eval(initiator_target_map)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue