Skip to content

Commit

Permalink
Old work + test redfish API
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Aug 10, 2023
1 parent 3aad740 commit 4d28262
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions providers/redfish/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ func (c *Conn) FirmwareInstallStatus(ctx context.Context, installVersion, compon
break
}

//task, err := gofishrf.GetTask(c.redfishwrapper, "/redfish/v1/TaskService/Tasks/" + taskID)
//fmt.Printf("task:", task);

data, _ := io.ReadAll(resp.Body)
resp.Body.Close()

Expand All @@ -198,14 +201,12 @@ func (c *Conn) FirmwareInstallStatus(ctx context.Context, installVersion, compon
return state, err
}

if state == "" {
if task == nil {
return state, errors.New("failed to lookup task status for task ID: " + taskID)
}

state = strings.ToLower(string(task.TaskState))
if task == nil {
return state, errors.New("failed to lookup task status for task ID: " + taskID)
}

state = strings.ToLower(string(task.TaskState))

// so much for standards...
switch state {
case "starting", "downloading", "downloaded":
Expand Down

0 comments on commit 4d28262

Please sign in to comment.