Skip to content

Commit

Permalink
providers: merge changes from master, a few suggested fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Apr 26, 2022
1 parent edb3e1c commit e8f9059
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions providers/asrockrack/asrockrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"bytes"
"context"
"crypto/x509"
"fmt"
"io"
"net/http"

"github.com/bmc-toolbox/bmclib/devices"
Expand Down
7 changes: 5 additions & 2 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/bmc-toolbox/bmclib/devices"
bmclibErrs "github.com/bmc-toolbox/bmclib/errors"
"github.com/bmc-toolbox/bmclib/internal"
)

const (
Expand Down Expand Up @@ -179,6 +180,10 @@ func (a *ASRockRack) firmwareUpdateStatus(ctx context.Context, component string,
// - 1 indicates the given version parameter does not match the version installed
// - 2 the version parameter returned from the BMC is empty (which means the BMC needs a reset)
func (a *ASRockRack) versionInstalled(ctx context.Context, component, version string) (status int, err error) {
if !internal.StringInSlice(component, []string{devices.SlugBIOS, devices.SlugBMC}) {
return versionStrError, errors.Wrap(bmclibErrs.ErrFirmwareInstall, "component unsupported: "+component)
}

fwInfo, err := a.firmwareInfo(ctx)
if err != nil {
err = errors.Wrap(err, "error querying for firmware info: ")
Expand All @@ -193,8 +198,6 @@ func (a *ASRockRack) versionInstalled(ctx context.Context, component, version st
installed = fwInfo.BIOSVersion
case devices.SlugBMC:
installed = fwInfo.BMCVersion
default:
return versionStrError, errors.Wrap(bmclibErrs.ErrFirmwareInstall, "component unsupported: "+component)
}

// version match
Expand Down
2 changes: 1 addition & 1 deletion providers/redfish/redfish.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Conn) Open(ctx context.Context) (err error) {
}

config := gofish.ClientConfig{
Endpoint: "https://" + c.Host,
Endpoint: c.Host,
Username: c.User,
Password: c.Pass,
Insecure: true,
Expand Down

0 comments on commit e8f9059

Please sign in to comment.