fix: pick the correct manager/system on multi-system, multi-chassis hosts#108
Open
shevchenko-evgeny wants to merge 1 commit into
Open
fix: pick the correct manager/system on multi-system, multi-chassis hosts#108shevchenko-evgeny wants to merge 1 commit into
shevchenko-evgeny wants to merge 1 commit into
Conversation
…osts Match the system by presence of a Bios resource and select the manager whose Links.ManagerForServers references it, instead of blindly taking the first entry. Adds ManagerLinks, get_manager_with_id, is_bios_attributes. Signed-off-by: Evgeny Shevchenko <eshevchenko@mirantis.com>
| // call set_system_id always before calling set_vendor | ||
| s.set_system_id(system_id)?; | ||
|
|
||
| // Try to find manager with ManagerForServers related to System |
There was a problem hiding this comment.
It might be better to look at the ManagedBy Link on the chosen System to pick the manager instead of traversing all managers for the selected System:
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/BMC_0"
}
],
|
|
||
| //Find another system with BIOS section | ||
| let mut system_with_bios = None; | ||
| for system_member in &systems { |
There was a problem hiding this comment.
Would be better to use the bios property on the fetched System itself:
for id in &systems {
let Ok((_, system)) = s
.client
.get::<ComputerSystem>(&format!("Systems/{id}"))
.await
else {
break; // Use the existing fallback.
};
if system.bios.is_some() {
system_id = id;
break;
}
}
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.
Match the system by presence of a Bios resource and select the manager whose Links.ManagerForServers references it, instead of blindly taking the first entry.