mirror of
https://opendev.org/x/pyghmi
synced 2026-01-11 18:52:33 +00:00
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
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user