From 6a1d453ef0dd9536e500ff8c45846826dca40e8b Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 23 Mar 2020 11:15:25 -0700 Subject: [PATCH] Make deploy step failure logging indicate the error Deploy step logging would previously only log the step to the API user, instead of anything the API user could use to try and determine what is wrong. Example: - Trying to power on a machine as part of deploy.deploy() - Power-on operation fails - Only the deploy step is listed as the error, and no additional information to troubleshoot the issue, which forced the operator to go examine logs and find the error. Change-Id: If60b96dcafa446de090df56089760eda3a21109d --- ironic/conductor/deployments.py | 5 ++++- releasenotes/notes/deploy-step-error-d343e8cb7d1b2305.yaml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/deploy-step-error-d343e8cb7d1b2305.yaml diff --git a/ironic/conductor/deployments.py b/ironic/conductor/deployments.py index c04b578d62..d7b49abcef 100644 --- a/ironic/conductor/deployments.py +++ b/ironic/conductor/deployments.py @@ -249,7 +249,10 @@ def do_next_deploy_step(task, step_index, conductor_id): {'node': node.uuid, 'step': node.deploy_step, 'err': e}) utils.deploying_error_handler( task, log_msg, - _("Failed to deploy: %s") % node.deploy_step) + _("Failed to deploy: Deploy step %(step)s, " + "error: %(err)s.") % { + 'step': node.deploy_step, + 'err': e}) return except Exception as e: log_msg = ('Node %(node)s failed deploy step %(step)s with ' diff --git a/releasenotes/notes/deploy-step-error-d343e8cb7d1b2305.yaml b/releasenotes/notes/deploy-step-error-d343e8cb7d1b2305.yaml new file mode 100644 index 0000000000..9af1e9782e --- /dev/null +++ b/releasenotes/notes/deploy-step-error-d343e8cb7d1b2305.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes vague node ``last_error`` field reporting upon deploy step + failure by providing the exception error message in addition + to the step that failed.