More minor changes

This commit is contained in:
David J. Allen 2024-05-08 13:29:07 -06:00
parent 2289209604
commit c041acafee
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
2 changed files with 55 additions and 72 deletions

View file

@ -117,7 +117,7 @@ func (c *Client) AddRedfishEndpoint(data []byte, headers map[string]string) erro
func (c *Client) UpdateRedfishEndpoint(xname string, data []byte, headers map[string]string) error {
if data == nil {
return fmt.Errorf("could not add redfish endpoint: no data found")
return fmt.Errorf("failed to add redfish endpoint: no data found")
}
// Update redfish endpoint via PUT `/hsm/v2/Inventory/RedfishEndpoints` endpoint
url := makeEndpointUrl("/Inventory/RedfishEndpoints/" + xname)
@ -126,7 +126,7 @@ func (c *Client) UpdateRedfishEndpoint(xname string, data []byte, headers map[st
if res != nil {
statusOk := res.StatusCode >= 200 && res.StatusCode < 300
if !statusOk {
return fmt.Errorf("could not update redfish endpoint")
return fmt.Errorf("failed to update redfish endpoint (returned %s)", res.Status)
}
}
return err