From ca6499b62c47b6588b2382f442dbc690140453d5 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 6 Jan 2022 16:59:16 +0000 Subject: [PATCH] Make bootloader installation failures fatal for whole disk images Since I4f2cecdc0af366364b18232dbd8ea4ffdd3165d2, bootloader installation failures were ignored to facilitate backwards compatibility with older Ironic Python Agents. However, this means that some genuine failures are ignored. We can now rely on having a sufficiently modern IPA, so this patch makes bootloader installation failures fatal for whole disk images. Change-Id: Ic280cc3e1a2bb462d5425efd71b336db8c14bb90 --- ironic/drivers/modules/agent_base.py | 19 +++++-------------- ...loader-install-fatal-6f1b9fed1d2c0ee4.yaml | 7 +++++++ 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 releasenotes/notes/bootloader-install-fatal-6f1b9fed1d2c0ee4.yaml diff --git a/ironic/drivers/modules/agent_base.py b/ironic/drivers/modules/agent_base.py index 8f5a4412a6..371b603a78 100644 --- a/ironic/drivers/modules/agent_base.py +++ b/ironic/drivers/modules/agent_base.py @@ -1335,20 +1335,11 @@ class AgentDeployMixin(HeartbeatMixin, AgentOobStepsMixin): software_raid=software_raid ) if result['command_status'] == 'FAILED': - if not whole_disk_image: - msg = (_("Failed to install a bootloader when " - "deploying node %(node)s. Error: %(error)s") % - {'node': node.uuid, - 'error': agent_client.get_command_error(result)}) - log_and_raise_deployment_error(task, msg) - else: - # Its possible the install will fail if the IPA image - # has not been updated, log this and continue - LOG.info('Could not install bootloader for whole disk ' - 'image for node %(node)s, Error: %(error)s"', - {'node': node.uuid, - 'error': agent_client.get_command_error(result)}) - return + msg = (_("Failed to install a bootloader when " + "deploying node %(node)s. Error: %(error)s") % + {'node': node.uuid, + 'error': agent_client.get_command_error(result)}) + log_and_raise_deployment_error(task, msg) try: persistent = True diff --git a/releasenotes/notes/bootloader-install-fatal-6f1b9fed1d2c0ee4.yaml b/releasenotes/notes/bootloader-install-fatal-6f1b9fed1d2c0ee4.yaml new file mode 100644 index 0000000000..786bf0cea6 --- /dev/null +++ b/releasenotes/notes/bootloader-install-fatal-6f1b9fed1d2c0ee4.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Bootloader installation failures are now fatal for whole disk images. + Previously these failures were ignored to facilitate backwards + compatibility with older Ironic Python Agents, however we can now rely on + having a sufficiently modern IPA.