Skip to content

Commit

Permalink
Traces firmwareInstallBMC
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Nov 10, 2023
1 parent 8329b0d commit e7c94a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
fwEndpoint = "api/maintenance/firmware/firmware"
}

mybytes, err = io.ReadAll(reader)
fmt.Printf("ReadAll reader before uploadFW len:%d\n", len(mybytes))

if file, ok := reader.(*os.File); ok {
fmt.Printf("Seek before upload\n")
file.Seek(0, 0)

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

View workflow job for this annotation

GitHub Actions / lint

Error return value of `file.Seek` is not checked (errcheck)
Expand All @@ -114,20 +111,23 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f
return errors.Wrap(err, "failed in step 2/4 - upload BMC firmware image")
}

fmt.Printf("VERIFY\n")
// 3. BMC to verify the uploaded file
err = a.verifyUploadedFirmware(ctx)
a.log.V(2).WithValues("step", "3/4").Info("verify uploaded BMC firmware")
if err != nil {
return errors.Wrap(err, "failed in step 3/4 - verify uploaded BMC firmware")
}

fmt.Printf("UPGRADE\n")
// 4. Run the upgrade - preserving current config
a.log.V(2).WithValues("step", "4/4").Info("proceed with BMC firmware install, preserve current configuration")
err = a.upgradeBMC(ctx)
if err != nil {
return errors.Wrap(err, "failed in step 4/4 - proceed with BMC firmware install")
}

fmt.Printf("firmwareInstallBMC END\n")
return nil
}

Expand Down

0 comments on commit e7c94a1

Please sign in to comment.