Keep original error message when cleaning tear down fails
Currenty we set last_error to ""Failed to tear down from cleaning for node". This change adds a real reason to it for simpler debugging. Change-Id: I57866c00f4b75cd7de8d4080716a26dea9f63759
This commit is contained in:
parent
d5184813f5
commit
86a9897769
@ -1003,8 +1003,9 @@ class ConductorManager(base_manager.BaseConductorManager):
|
|||||||
try:
|
try:
|
||||||
task.driver.deploy.tear_down_cleaning(task)
|
task.driver.deploy.tear_down_cleaning(task)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = (_('Failed to tear down from cleaning for node %s')
|
msg = (_('Failed to tear down from cleaning for node %(node)s, '
|
||||||
% node.uuid)
|
'reason: %(err)s')
|
||||||
|
% {'node': node.uuid, 'err': e})
|
||||||
LOG.exception(msg)
|
LOG.exception(msg)
|
||||||
return utils.cleaning_error_handler(task, msg,
|
return utils.cleaning_error_handler(task, msg,
|
||||||
tear_down_cleaning=False)
|
tear_down_cleaning=False)
|
||||||
|
@ -2058,7 +2058,7 @@ class DoNodeCleanTestCase(mgr_utils.ServiceSetUpMixin,
|
|||||||
|
|
||||||
deploy_exec_mock.return_value = None
|
deploy_exec_mock.return_value = None
|
||||||
power_exec_mock.return_value = None
|
power_exec_mock.return_value = None
|
||||||
tear_mock.side_effect = Exception()
|
tear_mock.side_effect = Exception('boom')
|
||||||
|
|
||||||
self._start_service()
|
self._start_service()
|
||||||
|
|
||||||
@ -2088,7 +2088,8 @@ class DoNodeCleanTestCase(mgr_utils.ServiceSetUpMixin,
|
|||||||
]
|
]
|
||||||
self.assertEqual(power_exec_calls, power_exec_mock.call_args_list)
|
self.assertEqual(power_exec_calls, power_exec_mock.call_args_list)
|
||||||
log_mock.exception.assert_called_once_with(
|
log_mock.exception.assert_called_once_with(
|
||||||
'Failed to tear down from cleaning for node {}'.format(node.uuid))
|
'Failed to tear down from cleaning for node {}, reason: boom'
|
||||||
|
.format(node.uuid))
|
||||||
|
|
||||||
def test__do_next_clean_step_automated_fail_in_tear_down_cleaning(self):
|
def test__do_next_clean_step_automated_fail_in_tear_down_cleaning(self):
|
||||||
self._do_next_clean_step_fail_in_tear_down_cleaning()
|
self._do_next_clean_step_fail_in_tear_down_cleaning()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user