Skip to content

Commit

Permalink
redfishwrapper/firmware: lets not strip the JID_ prefix, since the me…
Browse files Browse the repository at this point in the history
…thod should be generic
  • Loading branch information
joelrebel committed Nov 28, 2023
1 parent 5622adc commit 63f4d53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions internal/redfishwrapper/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ func taskIDFromLocationHeader(uri string) (taskID string, err error) {
uri = strings.TrimSuffix(uri, "/")

switch {
// idracs return /redfish/v1/TaskService/Tasks/JID_467696020275
case strings.Contains(uri, "JID_"):
taskID = strings.Split(uri, "JID_")[1]
return taskID, nil

// OpenBMC returns /redfish/v1/TaskService/Tasks/12/Monitor
case strings.Contains(uri, "/Tasks/") && strings.HasSuffix(uri, "/Monitor"):
taskIDPart := strings.Split(uri, "/Tasks/")[1]
Expand Down
2 changes: 1 addition & 1 deletion internal/redfishwrapper/firmware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestTaskIDFromLocationHeader(t *testing.T) {
{
name: "task URI with JID",
uri: "http://foo/redfish/v1/TaskService/Tasks/JID_12345",
expectedID: "12345",
expectedID: "JID_12345",
expectedErr: nil,
},
{
Expand Down

0 comments on commit 63f4d53

Please sign in to comment.