mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
Changes for review comments
This commit is contained in:
parent
6698609aaa
commit
05fcefb243
@ -82,17 +82,13 @@ class OpenBMCPowerTask(ParallelNodesCommand):
|
||||
|
||||
if bmc_state != 'Ready':
|
||||
bmc_state = bmc_not_ready
|
||||
bmc_state_error = state.get('error')
|
||||
if bmc_state_error is not None:
|
||||
# BMC is not ready and we have some error as to why
|
||||
self.callback.info('%s: %s (%s)' % (node, openbmc.RPOWER_STATES.get(bmc_state, bmc_state), bmc_state_error))
|
||||
return bmc_state
|
||||
|
||||
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
|
||||
|
||||
|
@ -320,8 +320,6 @@ class OpenBMCRest(object):
|
||||
'Validate BMC configuration and retry the command.'
|
||||
self._print_error_log(e.message, cmd)
|
||||
raise
|
||||
except SelfClientException as e:
|
||||
raise SelfClientException(e.message, e.code)
|
||||
except ValueError:
|
||||
error = 'Received wrong format response: %s' % response
|
||||
self._print_error_log(error, cmd)
|
||||
@ -415,9 +413,6 @@ class OpenBMCRest(object):
|
||||
try:
|
||||
state = self.request('GET', BMC_URLS['state']['path'], cmd='get_bmc_state')
|
||||
return {'bmc': state.split('.')[-1]}
|
||||
except SelfClientException as e:
|
||||
# Return error message received from the request
|
||||
return {'bmc': "NotReady", 'error': e.message}
|
||||
except KeyError:
|
||||
error = 'Received wrong format response: %s' % state
|
||||
raise SelfServerException(error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user