diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py index 807c23f16..c3524cf9a 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py @@ -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 diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 241396df8..2640f76eb 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -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