Merge "Fix ISCSIConnector._get_potential_volume_paths logic"
This commit is contained in:
commit
0409bebbaf
|
@ -245,14 +245,13 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector):
|
|||
else:
|
||||
LOG.info("Multipath discovery for iSCSI not enabled.")
|
||||
iscsi_sessions = self._get_iscsi_sessions()
|
||||
iscsi_portals_with_sessions = [s[2] for s in iscsi_sessions]
|
||||
|
||||
host_devices = set()
|
||||
for props in self._iterate_all_targets(connection_properties):
|
||||
# If we aren't trying to connect to the portal, we
|
||||
# want to find ALL possible paths from all of the
|
||||
# alternate portals
|
||||
if props['target_portal'] in iscsi_portals_with_sessions:
|
||||
if props['target_portal'] in iscsi_sessions:
|
||||
paths = self._get_device_path(props)
|
||||
host_devices.update(paths)
|
||||
host_devices = list(host_devices)
|
||||
|
|
|
@ -911,9 +911,7 @@ Setting up iSCSI targets: unused
|
|||
get_sessions_mock):
|
||||
get_path_mock.side_effect = [['path1'], ['path2'], ['path3', 'path4']]
|
||||
get_sessions_mock.return_value = [
|
||||
('tcp:', 'session1', 'ip1:port1', '1', 'tgt1'),
|
||||
('tcp:', 'session2', 'ip2:port2', '-1', 'tgt2'),
|
||||
('tcp:', 'session3', 'ip3:port3', '1', 'tgt3')]
|
||||
'ip1:port1', 'ip2:port2', 'ip3:port3']
|
||||
|
||||
self.connector.use_multipath = False
|
||||
res = self.connector._get_potential_volume_paths(self.CON_PROPS)
|
||||
|
|
Loading…
Reference in New Issue