From 41ee6aa2fff39f28216981c2cc73ffddef26cb4c Mon Sep 17 00:00:00 2001 From: Sharpz7 Date: Sat, 10 Feb 2024 00:23:54 +0000 Subject: [PATCH] Ensure all errors are passed during cleaning Related Bug: https://bugs.launchpad.net/ironic/+bug/1628422 This change makes sure that the caught error is passed through to node_history_record() Change-Id: I9b78ec37f37024d04928403bbf0b85ed96906441 --- ironic/conductor/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py index 846fe309c1..b48c3f0020 100644 --- a/ironic/conductor/utils.py +++ b/ironic/conductor/utils.py @@ -480,7 +480,10 @@ def cleaning_error_handler(task, logmsg, errmsg=None, traceback=False, msg2 = ('Failed to tear down cleaning on node %(uuid)s, ' 'reason: %(err)s' % {'err': e, 'uuid': node.uuid}) LOG.exception(msg2) - errmsg = _('%s. Also failed to tear down cleaning.') % errmsg + errmsg = _( + '%(orig_err)s. ' + 'Also %(msg2)s' + ) % {'orig_err': errmsg, 'msg2': msg2} if node.provision_state in ( states.CLEANING,