Skip to content

Commit b470bef

Browse files
authored
fix: always map P3809 to either RedfishVendor::NvidiaGBSwitch or RedfishVendor::NvidiaGH200; (#58)
fix: always map P3809 to either RedfishVendor::NvidiaGBSwitch or RedfishVendor::NvidiaGH200; libredfish does not support creating a vendor specific client for P3809
1 parent d90e5d6 commit b470bef

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/network.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,19 @@ impl RedfishClientPool {
215215

216216
let vendor = match vendor {
217217
Some(v) => v,
218-
None => {
219-
let Some(mut v) = service_root.vendor() else {
220-
return Err(RedfishError::MissingVendor);
221-
};
222-
if v == RedfishVendor::P3809 {
223-
if chassis.contains(&"MGX_NVSwitch_0".to_string()) {
224-
v = RedfishVendor::NvidiaGBSwitch;
225-
} else {
226-
v = RedfishVendor::NvidiaGH200;
227-
}
228-
}
229-
v
218+
None => service_root.vendor().ok_or(RedfishError::MissingVendor)?,
219+
};
220+
221+
// P3809 is a placeholder — always resolve it based on chassis
222+
// contents, whether it was auto-detected or explicitly provided.
223+
let vendor = if vendor == RedfishVendor::P3809 {
224+
if chassis.contains(&"MGX_NVSwitch_0".to_string()) {
225+
RedfishVendor::NvidiaGBSwitch
226+
} else {
227+
RedfishVendor::NvidiaGH200
230228
}
229+
} else {
230+
vendor
231231
};
232232

233233
s.set_vendor(vendor).await

0 commit comments

Comments
 (0)