diff --git a/internal/redfishwrapper/firmware.go b/internal/redfishwrapper/firmware.go index 08ac4976..e81d7a21 100644 --- a/internal/redfishwrapper/firmware.go +++ b/internal/redfishwrapper/firmware.go @@ -19,6 +19,7 @@ import ( "github.com/bmc-toolbox/bmclib/v2/constants" bmclibErrs "github.com/bmc-toolbox/bmclib/v2/errors" + redfish "github.com/stmcginnis/gofish/redfish" ) type installMethod string @@ -99,6 +100,14 @@ func (c *Client) FirmwareUpload(ctx context.Context, updateFile *os.File, params ) } + // For X13 the full Task structure is returned in the body. If we can Unmarshall then we can safely assume + // that redfishTask.ID contains the ID. + redfishTask := &redfish.Task{} + err = json.Unmarshal(response, redfishTask) + if err == nil { + return redfishTask.ID, nil + } + // The response contains a location header pointing to the task URI // Location: /redfish/v1/TaskService/Tasks/JID_467696020275 var location = resp.Header.Get("Location")