Minor changes and fixes

This commit is contained in:
David J. Allen 2023-10-11 15:00:13 -06:00
parent 174e2084fc
commit b76d5e61ff
3 changed files with 17 additions and 17 deletions

View file

@ -51,11 +51,11 @@ func AddRedfishEndpoint(data []byte, headers map[string]string) error {
// Add redfish endpoint via POST `/hsm/v2/Inventory/RedfishEndpoints` endpoint
url := makeEndpointUrl("/Inventory/RedfishEndpoints")
res, body, err := util.MakeRequest(url, "POST", data, headers)
fmt.Printf("%v (%v)\n%s\n", url, res.Status, string(body))
if res != nil {
if res.StatusCode != http.StatusOK {
return fmt.Errorf("could not add redfish endpoint")
}
fmt.Printf("%v (%v)\n%s\n", url, res.Status, string(body))
}
return err
}