diff --git a/providers/hp/hp.go b/providers/hp/hp.go index 0f1794fd..35d96a52 100644 --- a/providers/hp/hp.go +++ b/providers/hp/hp.go @@ -203,6 +203,13 @@ type ChassisInfo struct { BayNumber int } } `json:"Oem"` + Error struct { + Code string `json:"code"` + Message string `json:"message"` + ExtendedMessage []*struct { + MessageId string `json:"MessageId"` + } `json:"@Message.ExtendedInfo"` + } `json:"error"` } // Mem is the struct used to render the data from https://$ip/json/mem_info, it contains the ram data diff --git a/providers/hp/ilo/ilo.go b/providers/hp/ilo/ilo.go index d3b946ba..577eb76f 100644 --- a/providers/hp/ilo/ilo.go +++ b/providers/hp/ilo/ilo.go @@ -512,6 +512,13 @@ func (i *Ilo) parseChassisInfo() (*hp.ChassisInfo, error) { if err != nil { return nil, err } + if chassisInfo.Error.Code != "" { + e := "Code: " + chassisInfo.Error.Code + ", Message: " + chassisInfo.Error.Message + for i, s := range chassisInfo.Error.ExtendedMessage { + e += fmt.Sprintf(", Extended[%d]: %s", i, s) + } + return nil, fmt.Errorf(e) + } // Matching the new interface to the old one, since the code still drops // off to the old interface in case the new interface is not available.