2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

Merge "Raise IpmiException on error checking power state"

This commit is contained in:
Jenkins 2016-12-01 18:14:26 +00:00 committed by Gerrit Code Review
commit 369f8440fa

View File

@ -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: