Skip to content

Deduplicate crawled ComputerSystems across Systems and Chassis endpoints#111

Merged
davidallendj merged 2 commits into
mainfrom
lritzdorf/dedup-crawled-systems
Jul 24, 2025
Merged

Deduplicate crawled ComputerSystems across Systems and Chassis endpoints#111
davidallendj merged 2 commits into
mainfrom
lritzdorf/dedup-crawled-systems

Conversation

@LRitzdorf

Copy link
Copy Markdown
Collaborator

Magellan already accounts for a complication where some BMCs expose their ComputerSystems under /redfish/v1/Chassis instead 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 the Systems endpoint may be missing chassis information.)

This PR adds logic to merge duplicate ComputerSystems from the two endpoints. Duplicate systems found in Systems are merged onto their counterparts from Chassis, i.e. any non-empty fields override their existing counterparts. (The Systems endpoint 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.

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>
@LRitzdorf
LRitzdorf requested a review from davidallendj July 24, 2025 18:37

@davidallendj davidallendj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tried it, it worked, and it seemed to remove the duplicates like expected.

@davidallendj
davidallendj merged commit bf863cf into main Jul 24, 2025
4 checks passed
@LRitzdorf
LRitzdorf deleted the lritzdorf/dedup-crawled-systems branch July 24, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants