purefa_info: host login ports and preferred-arrays crash fix - #1027
Merged
sdodsley merged 2 commits intoJul 21, 2026
Conversation
sdodsley
force-pushed
the
purefa-info-host-dict
branch
from
July 17, 2026 15:53
3022fd4 to
f2c7590
Compare
Two related fixes to the hosts subset of purefa_info:
- Add logged_in_ports to each host, built from get_ports_initiators,
mapping every host WWN/IQN/NQN to the array target ports (e.g. CT0.FC1)
it is currently logged into. An empty list means the identifier is not
logged in anywhere and can be safely removed. WWNs are matched case- and
separator-insensitively.
- Fix a TypeError ("list indices must be integers or slices, not Reference")
raised whenever a host had preferred arrays set. preferred_arrays is a
list of Reference objects, but the code indexed the list by the iterated
Reference; iterate and use each element's .name instead.
Tests: added logged_in_ports coverage and a preferred_arrays regression
test (the existing test only used an empty preferred_arrays, which never
exercised the crash).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sdodsley
force-pushed
the
purefa-info-host-dict
branch
from
July 17, 2026 15:54
f2c7590 to
78a8bae
Compare
Removing a single WWN, IQN or NQN from a host was not possible: the module only ever sent the full desired list in the patch_hosts wwns/ iqns/nqns fields, which *replace* the whole associated list, so it could not drop one initiator while keeping the rest. Treat the supplied list as the complete desired set and reconcile to it using the add_*/remove_* fields (--addwwnlist/--remwwnlist), not the replacing wwns/iqns/nqns fields (--wwnlist): add only the missing initiators and remove only the unwanted ones in a single patch. An unused WWN can now be removed simply by omitting it, and the initiators that stay are left untouched instead of being removed and re-added. Signed-off-by: Simon Dodsley <simon@everpuredata.com>
sdodsley
force-pushed
the
purefa-info-host-dict
branch
2 times, most recently
from
July 21, 2026 14:01
d06de5a to
23a1a93
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Two related fixes to the hosts subset of purefa_info:
Tests: added logged_in_ports coverage and a preferred_arrays regression test (the existing test only used an empty preferred_arrays, which never exercised the crash).
Closes #1026
Closes #992
ISSUE TYPE
COMPONENT NAME
purefa_info.py