Deduplicate crawled ComputerSystems across Systems and Chassis endpoints#111
Merged
Conversation
Signed-off-by: Lucas Ritzdorf <42657792+LRitzdorf@users.noreply.github.com>
…ints Some Redfish interfaces apparently expose ComputerSystems under both `/redfish/v1/Chassis` and `/redfish/v1/Systems`. Previously, this would cause crawling to list the same system twice. Now, we compare systems' URIs to identify when the same system is returned by both endpoints, and merge their properties. In this merge, the ComputerSystem from the Systems endpoint is considered "more correct," so its (non-empty) properties will override those of the system from Chassis. Signed-off-by: Lucas Ritzdorf <42657792+LRitzdorf@users.noreply.github.com>
davidallendj
approved these changes
Jul 24, 2025
davidallendj
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. I tried it, it worked, and it seemed to remove the duplicates like expected.
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.
Magellan already accounts for a complication where some BMCs expose their ComputerSystems under
/redfish/v1/Chassisinstead of.../Systems.,However, the existing logic just concatenates the two sets of ComputerSystems found in this way, which is a problem if the same systems are exposed under each of the two endpoints — we end up with two entries for each system. (Confusingly, pairs entries are not actually identical; ones from theSystemsendpoint may be missing chassis information.)This PR adds logic to merge duplicate ComputerSystems from the two endpoints. Duplicate systems found in
Systemsare merged onto their counterparts fromChassis, i.e. any non-empty fields override their existing counterparts. (TheSystemsendpoint is the canonical location for ComputerSystems, so entries from there get priority.)Also, another included commit fixes a CLI-binding typo for the access token flag.