Return WWN in multipath_id

When we refactored the iSCSI connect mechanism we inadvertently changed
the value returned for the "multipath_id" key.

This patch fixes this and return the WWN as the value again.

This value is used by the encryption mechanism and expects it to be the
WWN.

Related-Bug: #1703954
Change-Id: Ia6d96a1e3a71488b44b3ca2323610a8f0a7cf675
This commit is contained in:
Gorka Eguileor 2017-07-12 20:04:57 +02:00
parent f341e9c3ed
commit 66520dcf6c
2 changed files with 4 additions and 4 deletions

View File

@ -542,7 +542,7 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector):
result = {'type': 'block', 'scsi_wwn': wwn, 'path': device}
if mpath:
result['multipath_id'] = mpath
result['multipath_id'] = wwn
return result
@utils.retry(exceptions=(exception.VolumeDeviceNotFound))

View File

@ -1107,7 +1107,7 @@ Setting up iSCSI targets: unused
res = self.connector._connect_multipath_volume(self.CON_PROPS)
expected = {'type': 'block', 'scsi_wwn': 'wwn', 'multipath_id': 'dm-0',
expected = {'type': 'block', 'scsi_wwn': 'wwn', 'multipath_id': 'wwn',
'path': '/dev/dm-0'}
self.assertEqual(expected, res)
@ -1176,7 +1176,7 @@ Setting up iSCSI targets: unused
res = self.connector._connect_multipath_volume(self.CON_PROPS)
expected = {'type': 'block', 'scsi_wwn': 'wwn', 'multipath_id': 'dm-0',
expected = {'type': 'block', 'scsi_wwn': 'wwn', 'multipath_id': 'wwn',
'path': '/dev/dm-0'}
self.assertEqual(expected, res)
self.assertEqual(1, get_wwn_mock.call_count)
@ -1386,7 +1386,7 @@ Setting up iSCSI targets: unused
res = self.connector._get_connect_result(props, 'wwn', ['sda', 'sdb'],
'mpath')
expected = {'type': 'block', 'scsi_wwn': 'wwn', 'path': '/dev/mpath',
'multipath_id': 'mpath'}
'multipath_id': 'wwn'}
self.assertDictEqual(expected, res)
get_link_mock.assert_not_called()