Trivial: shorten the deploy/clean step failure message

It looks like this now:

Agent returned error for deploy step {'step': 'write_image', 'priority': 80,
'argsinfo': None, 'interface': 'deploy'} on node
878c3113-0035-5033-9f99-46520b89b56d : Error performing deploy_step
write_image: <next level error message>

Change-Id: Iabfb802cbfb96a9a02d6811f450f151623d5ca1f
This commit is contained in:
Dmitry Tantsur 2021-09-07 14:54:37 +02:00
parent 8ea1a438d3
commit a76fc6f54e
2 changed files with 8 additions and 4 deletions

View File

@ -1060,12 +1060,12 @@ class AgentDeployMixin(HeartbeatMixin, AgentOobStepsMixin):
return
if command.get('command_status') == 'FAILED':
msg = (_('Agent returned error for %(type)s step %(step)s on node '
'%(node)s : %(err)s.') %
msg = (_('%(type)s step %(step)s failed on node %(node)s. '
'%(err)s') %
{'node': node.uuid,
'err': agent_client.get_command_error(command),
'step': current_step,
'type': step_type})
'step': conductor_steps.step_id(current_step),
'type': step_type.capitalize()})
return _step_failure_handler(task, msg, step_type)
# NOTE(dtantsur): VERSION_MISMATCH is a new alias for
# CLEAN_VERSION_MISMATCH, remove the old one after IPA removes it.

View File

@ -1703,6 +1703,10 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
}]
with task_manager.acquire(self.context, self.node['uuid'],
shared=False) as task:
task.node.clean_step = {
'step': 'erase_devices',
'interface': 'deploy',
}
self.deploy.continue_cleaning(task)
error_mock.assert_called_once_with(task, mock.ANY, traceback=False)
collect_logs_mock.assert_called_once_with(task.node,