Merge "3PAR get host by WWN now handles mixed cases"

This commit is contained in:
Jenkins 2016-02-23 17:56:01 +00:00 committed by Gerrit Code Review
commit c4770f7466
2 changed files with 23 additions and 2 deletions

View File

@ -5334,6 +5334,26 @@ class TestHPE3PARFCDriver(HPE3PARBaseDriver, test.TestCase):
self.standard_logout)
self.assertNotIn('initiator_target_map', conn_info['data'])
def test_get_3par_host_from_wwn_iqn(self):
mock_client = self.setup_driver()
mock_client.getHosts.return_value = {
'name': self.FAKE_HOST,
'FCPaths': [{'driverVersion': None,
'firmwareVersion': None,
'hostSpeed': 0,
'model': None,
'portPos': {'cardPort': 1, 'node': 1,
'slot': 2},
'vendor': None,
'wwn': '123ab6789012345'}]}
with mock.patch.object(hpecommon.HPE3PARCommon,
'_create_client') as mock_create_client:
mock_create_client.return_value = mock_client
hostname = mock_client._get_3par_hostname_from_wwn_iqn(
wwns=['123AB6789012345', '123CD6789054321'],
iqns=None)
self.assertIsNotNone(hostname)
def test_get_volume_stats1(self):
# setup_mock_client drive with the configuration
# and return the mock HTTP 3PAR client

View File

@ -226,10 +226,11 @@ class HPE3PARCommon(object):
3.0.11 - Fix the image cache capability bug #1491088
3.0.12 - Remove client version checks for replication
3.0.13 - Support creating a cg from a source cg
3.0.14 - Comparison of WWNs now handles case difference. bug #1546453
"""
VERSION = "3.0.13"
VERSION = "3.0.14"
stats = {}
@ -2487,7 +2488,7 @@ class HPE3PARCommon(object):
fc_paths = host['FCPaths']
for fc in fc_paths:
for wwn in wwns:
if wwn == fc['wwn']:
if wwn.upper() == fc['wwn'].upper():
return host['name']
def terminate_connection(self, volume, hostname, wwn=None, iqn=None):