Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Nov 24, 2023
1 parent c045075 commit 499447f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions internal/redfishwrapper/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func (c *Client) SystemForceOff(ctx context.Context) (ok bool, err error) {

system.DisableEtagMatch(c.disableEtagMatch)


err = system.Reset(rf.ForceOffResetType)
if err != nil {
return false, err
Expand Down
15 changes: 4 additions & 11 deletions providers/supermicro/supermicro.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type bmcQueryor interface {
deviceModel() (model string)
supportsInstall(component string) error
inventory(ctx context.Context) (*common.Device, error)
powerSet(ctx context.Context, state string) (ok bool, err error)
}

// New returns connection with a Supermicro client initialized
Expand Down Expand Up @@ -201,6 +200,10 @@ func (c *Client) PowerStateGet(ctx context.Context) (state string, err error) {

// PowerSet sets the power state of a server
func (c *Client) PowerSet(ctx context.Context, state string) (ok bool, err error) {
if c.serviceClient == nil || c.serviceClient.redfish == nil {
return false, errors.Wrap(bmclibErrs.ErrLoginFailed, "client not initialized")
}

return c.serviceClient.redfish.PowerSet(ctx, state)
}

Expand Down Expand Up @@ -359,16 +362,6 @@ func (c *Client) initScreenPreview(ctx context.Context) error {
return nil
}

// PowerSet sets the power state of a server
func (c *Client) PowerSet(ctx context.Context, state string) (ok bool, err error) {
switch strings.ToLower(state) {
case "cycle":
return c.powerCycle(ctx)
default:
return false, errors.New("action not implemented for provider")
}
}

type serviceClient struct {
host string
port string
Expand Down

0 comments on commit 499447f

Please sign in to comment.