Skip to content

Commit

Permalink
Fix Output.PowerControl PowerState argument type
Browse files Browse the repository at this point in the history
The PowerState property is the common PowerState enum, but the action
call for PowerControl needs to use the more limited ActionPowerState
that only includes the valid power control request state.

Signed-off-by: Sean McGinnis <[email protected]>
  • Loading branch information
stmcginnis committed May 20, 2024
1 parent 7cbe910 commit 48b8b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions redfish/outlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ func (outlet *Outlet) UnmarshalJSON(b []byte) error {
}

// PowerControl controls the power state of the outlet.
func (outlet *Outlet) PowerControl(powerState PowerState) error {
func (outlet *Outlet) PowerControl(powerState ActionPowerState) error {
params := struct {
PowerState PowerState
PowerState ActionPowerState
}{
PowerState: powerState,
}
Expand Down
2 changes: 1 addition & 1 deletion redfish/outlet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestOutletPowerControl(t *testing.T) {
testClient := &common.TestClient{}
result.SetClient(testClient)

err = result.PowerControl(OffPowerState)
err = result.PowerControl(OffActionPowerState)
if err != nil {
t.Errorf("Error making PowerControl call: %s", err)
}
Expand Down

0 comments on commit 48b8b0f

Please sign in to comment.