From 6cd86d15627e6c9d10317cc9c3755a1ccb4952c5 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Mon, 20 May 2024 08:42:24 -0500 Subject: [PATCH] Fix Output.PowerControl PowerState argument type 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 --- redfish/outlet.go | 4 ++-- redfish/outlet_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/redfish/outlet.go b/redfish/outlet.go index 9d89b53a..4e33f50f 100644 --- a/redfish/outlet.go +++ b/redfish/outlet.go @@ -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, } diff --git a/redfish/outlet_test.go b/redfish/outlet_test.go index 53eb7bc3..aeefd555 100644 --- a/redfish/outlet_test.go +++ b/redfish/outlet_test.go @@ -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) }