mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed issue QueryEthernetInterfaces not returning anything
This commit is contained in:
parent
4f839a5b61
commit
346d886edb
1 changed files with 16 additions and 1 deletions
|
|
@ -465,8 +465,23 @@ func QueryEthernetInterfaces(client *bmclib.Client, q *QueryParams) ([]byte, err
|
|||
return nil, fmt.Errorf("could not connect to bmc: %v", err)
|
||||
}
|
||||
|
||||
interfaces, err := redfish.ListReferencedEthernetInterfaces(c, "/redfish/v1/Systems/Self/EthernetInterfaces/")
|
||||
systems, err := c.Service.Systems()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not query storage systems (%v:%v): %v", q.Host, q.Port, err)
|
||||
}
|
||||
|
||||
|
||||
var interfaces []*redfish.EthernetInterface
|
||||
for _, system := range systems {
|
||||
fmt.Printf("%s\n", system.ID + "/EthernetInterfaces/")
|
||||
i, err := redfish.ListReferencedEthernetInterfaces(c, "/redfish/v1/Systems/" + system.ID + "/EthernetInterfaces/")
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
interfaces = append(interfaces, i...)
|
||||
}
|
||||
|
||||
if len(interfaces) <= 0 {
|
||||
return nil, fmt.Errorf("could not get ethernet interfaces: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue