mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 03:37:47 +00:00
Merge "Raise IpmiException on error checking power state"
This commit is contained in:
commit
369f8440fa
@ -257,6 +257,7 @@ class Command(object):
|
||||
requested state change for 300 seconds.
|
||||
If a non-zero number, adjust the wait time to the
|
||||
requested number of seconds
|
||||
:raises: IpmiException on an error
|
||||
:returns: dict -- A dict describing the response retrieved
|
||||
"""
|
||||
if powerstate not in power_states:
|
||||
@ -289,7 +290,7 @@ class Command(object):
|
||||
while currpowerstate != waitpowerstate and waitattempts > 0:
|
||||
response = self.raw_command(netfn=0, command=1, delay_xmit=1)
|
||||
if 'error' in response:
|
||||
return response
|
||||
raise exc.IpmiException(response['error'])
|
||||
currpowerstate = 'on' if (response['data'][0] & 1) else 'off'
|
||||
waitattempts -= 1
|
||||
if currpowerstate != waitpowerstate:
|
||||
|
Loading…
x
Reference in New Issue
Block a user