From 89f2f49e23f4c845e2305236289c27981032dd0d Mon Sep 17 00:00:00 2001 From: Joel Rebello Date: Thu, 18 Apr 2024 11:10:58 +0200 Subject: [PATCH] Revert "providers/openbmc: verify hardware support in all methods" This reverts commit 902ddd166b09206235070846d50a5624732fea8d. --- providers/openbmc/firmware.go | 4 ---- providers/openbmc/openbmc.go | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/providers/openbmc/firmware.go b/providers/openbmc/firmware.go index 851ce040..d5fd492a 100644 --- a/providers/openbmc/firmware.go +++ b/providers/openbmc/firmware.go @@ -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) } diff --git a/providers/openbmc/openbmc.go b/providers/openbmc/openbmc.go index 556f698a..8e9cde11 100644 --- a/providers/openbmc/openbmc.go +++ b/providers/openbmc/openbmc.go @@ -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 ( @@ -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) }