Skip to content

Commit

Permalink
Add traces before call
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Nov 10, 2023
1 parent 1ff6687 commit be814d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
return errors.Wrap(err, "failed to get model in step 0/4")
}

mybytes, err := io.ReadAll(reader)

Check failure on line 79 in providers/asrockrack/firmware.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to err (ineffassign)
fmt.Printf("ReadAll reader afterFRU len:%d\n", len(mybytes))

// 1. set the device to flash mode - prepares the flash
// Beware: this locks some capabilities, e.g. the access to fruAttributes
a.log.V(2).WithValues("step", "1/4").Info("set device to flash mode, takes a minute...")
Expand All @@ -84,14 +87,17 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
return errors.Wrap(err, "failed in step 1/4 - set device to flash mode")
}

mybytes, err = io.ReadAll(reader)

Check failure on line 90 in providers/asrockrack/firmware.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to err (ineffassign)
fmt.Printf("ReadAll reader after setFlashMode len:%d\n", len(mybytes))

// 2. upload firmware image file
fwEndpoint := "api/maintenance/firmware"
// E3C256D4ID-NL calls a different endpoint for firmware upload
if strings.EqualFold(device.Model, "E3C256D4ID-NL") {
fwEndpoint = "api/maintenance/firmware/firmware"
}

mybytes, err := io.ReadAll(reader)
mybytes, err = io.ReadAll(reader)

Check failure on line 100 in providers/asrockrack/firmware.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to err (ineffassign)
fmt.Printf("ReadAll reader before uploadFW len:%d\n", len(mybytes))

a.log.V(2).WithValues("step", "2/4").Info("upload BMC firmware image to " + fwEndpoint)
Expand Down

0 comments on commit be814d3

Please sign in to comment.