From 3fada0442cb04a5d49f4534bc2d3306b6a0d16f7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 30 Apr 2025 11:24:38 -0400 Subject: [PATCH] Replace set_power manual call to grab_json_response The manual call is more work and missing some common handling like for the authentication token. Change-Id: Ia9b3d8aec6a672a0fb2cf10cb4c81761892c9580 --- pyghmi/redfish/command.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 67eec1a0..b7352f08 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -522,10 +522,8 @@ class Command(object): raise exc.InvalidParameterValue( "Unknown power state %s requested" % powerstate) powerstate = powerstates[powerstate] - result = self.wc.grab_json_response_with_status( + self._do_web_request( self.powerurl, {'ResetType': powerstate}) - if result[1] < 200 or result[1] >= 300: - raise exc.PyghmiException(result[0]) if wait and reqpowerstate in ('on', 'off', 'softoff', 'shutdown'): if reqpowerstate in ('softoff', 'shutdown'): reqpowerstate = 'off'