Properly set vios_ids when discovering initiator

If vios_ids were not passed to discover_initiator, they get set to
a list of vioses instead of a list of the ids.

Change-Id: If4e2329022f4fb9b81c7b64238defc256bc00f66
Closes-bug: 1769919
This commit is contained in:
Taylor Jakobson 2018-05-08 12:24:47 -05:00
parent af0e814d62
commit 21f54185c6
2 changed files with 5 additions and 3 deletions

View File

@ -397,8 +397,9 @@ class TestISCSIAdapter(test_vol.TestVolumeAdapter):
vios_ids = ['1300C76F-9814-4A4D-B1F0-5B69352A7DEA',
'7DBBE705-E4C4-4458-8223-3EBE07015CA9']
mock_active_vioses.return_value = vios_ids
vios0 = mock.Mock(uuid=vios_ids[0])
vios1 = mock.Mock(uuid=vios_ids[1])
mock_active_vioses.return_value = [vios0, vios1]
expected_output = {
'1300C76F-9814-4A4D-B1F0-5B69352A7DEA': 'test_initiator',

View File

@ -82,7 +82,8 @@ def get_iscsi_initiators(adapter, vios_ids=None):
_discover_initiator()
if vios_ids is None and not _ISCSI_INITIATORS:
vios_ids = pvm_partition.get_active_vioses(adapter)
vios_list = pvm_partition.get_active_vioses(adapter)
vios_ids = [vios.uuid for vios in vios_list]
for vios_id in vios_ids or []:
discover_initiator(vios_id)