mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 03:32:04 +00:00
Merge pull request #4988 from gurevichmark/openbmc_getbmcstate
Catch BMC status error from get status request
This commit is contained in:
commit
8dc18c3989
@ -85,9 +85,10 @@ class OpenBMCPowerTask(ParallelNodesCommand):
|
||||
|
||||
self.callback.info('%s: %s' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state)))
|
||||
|
||||
except SelfServerException, SelfClientException:
|
||||
# There is no response when BMC is not ready
|
||||
except SelfServerException as e:
|
||||
self.callback.error(openbmc.RPOWER_STATES[bmc_not_ready], node)
|
||||
except SelfClientException as e:
|
||||
self.callback.error("%s (%s)" % (openbmc.RPOWER_STATES[bmc_not_ready], e.message), node)
|
||||
|
||||
return bmc_state
|
||||
|
||||
|
@ -424,8 +424,8 @@ class OpenBMCRest(object):
|
||||
|
||||
def get_bmc_state(self):
|
||||
|
||||
state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state')
|
||||
try:
|
||||
state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state')
|
||||
return {'bmc': state.split('.')[-1]}
|
||||
except KeyError:
|
||||
error = 'Received wrong format response: %s' % state
|
||||
|
Loading…
x
Reference in New Issue
Block a user