Skip to content

Commit

Permalink
Revert "providers/openbmc: verify hardware support in all methods"
Browse files Browse the repository at this point in the history
This reverts commit 902ddd1.
  • Loading branch information
joelrebel committed Apr 18, 2024
1 parent 47b2978 commit 89f2f49
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
4 changes: 0 additions & 4 deletions providers/openbmc/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,5 @@ func (c *Conn) checkQueueability(component string, tasks []*redfish.Task) error

// FirmwareTaskStatus returns the status of a firmware related task queued on the BMC.
func (c *Conn) FirmwareTaskStatus(ctx context.Context, kind constants.FirmwareInstallStep, component, taskID, installVersion string) (state constants.TaskState, status string, err error) {
if err := c.deviceSupported(ctx); err != nil {
return "", "", bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.TaskStatus(ctx, taskID)
}
22 changes: 0 additions & 22 deletions providers/openbmc/openbmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"github.com/go-logr/logr"
"github.com/jacobweinstock/registrar"
"github.com/pkg/errors"

bmcliberrs "github.com/bmc-toolbox/bmclib/v2/errors"
)

const (
Expand Down Expand Up @@ -169,45 +167,25 @@ func (c *Conn) Name() string {

// PowerStateGet gets the power state of a BMC machine
func (c *Conn) PowerStateGet(ctx context.Context) (state string, err error) {
if err := c.deviceSupported(ctx); err != nil {
return "", bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.SystemPowerStatus(ctx)
}

// PowerSet sets the power state of a server
func (c *Conn) PowerSet(ctx context.Context, state string) (ok bool, err error) {
if err := c.deviceSupported(ctx); err != nil {
return false, bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.PowerSet(ctx, state)
}

// Inventory collects hardware inventory and install firmware information
func (c *Conn) Inventory(ctx context.Context) (device *common.Device, err error) {
if err := c.deviceSupported(ctx); err != nil {
return nil, bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.Inventory(ctx, false)
}

// BmcReset power cycles the BMC
func (c *Conn) BmcReset(ctx context.Context, resetType string) (ok bool, err error) {
if err := c.deviceSupported(ctx); err != nil {
return false, bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.BMCReset(ctx, resetType)
}

// SendNMI tells the BMC to issue an NMI to the device
func (c *Conn) SendNMI(ctx context.Context) error {
if err := c.deviceSupported(ctx); err != nil {
return bmcliberrs.NewErrUnsupportedHardware(err.Error())
}

return c.redfishwrapper.SendNMI(ctx)
}

0 comments on commit 89f2f49

Please sign in to comment.