Skip to content

Commit a0438dc

Browse files
authored
Merge pull request #1509 from rackerlabs/ironic-patch-970922
fix(ironic): import patch for ironic#970922
2 parents 11a3011 + 67c7c29 commit a0438dc

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 30113a4c23e0aab9c108b0875f5a9099650a7552 Mon Sep 17 00:00:00 2001
2+
From: Doug Goldstein <[email protected]>
3+
Date: Fri, 12 Dec 2025 15:23:57 -0600
4+
Subject: [PATCH] fix: agent inspection hooks failure does not clean up
5+
6+
When the using the agent inspector interface and an exception happens
7+
during execution of the hook, the node is not cleaned up resulting in
8+
stale Neutron ports and ramdisk files.
9+
10+
Closes-Bug: 2135265
11+
Change-Id: I69ceec12fc0beea586176a768d864a22261cdb93
12+
Signed-off-by: Doug Goldstein <[email protected]>
13+
---
14+
ironic/drivers/modules/inspector/agent.py | 13 ++++++++++---
15+
...nspect-hooks-cleanup-error-c8901a7f8ad0dfd3.yaml | 7 +++++++
16+
2 files changed, 17 insertions(+), 3 deletions(-)
17+
create mode 100644 releasenotes/notes/agent-inspect-hooks-cleanup-error-c8901a7f8ad0dfd3.yaml
18+
19+
diff --git a/ironic/drivers/modules/inspector/agent.py b/ironic/drivers/modules/inspector/agent.py
20+
index 6f6555648..d14247d98 100644
21+
--- a/ironic/drivers/modules/inspector/agent.py
22+
+++ b/ironic/drivers/modules/inspector/agent.py
23+
@@ -84,9 +84,16 @@ class AgentInspect(common.Common):
24+
:param inventory: hardware inventory from the node.
25+
:param plugin_data: optional plugin-specific data.
26+
"""
27+
- # Run the inspection hooks
28+
- inspect_utils.run_inspection_hooks(task, inventory, plugin_data,
29+
- self.hooks, _store_logs)
30+
+
31+
+ try:
32+
+ # Run the inspection hooks
33+
+ inspect_utils.run_inspection_hooks(task, inventory, plugin_data,
34+
+ self.hooks, _store_logs)
35+
+ except Exception as exc:
36+
+ error = _("failed to run inspection hooks: %s") % exc
37+
+ common.inspection_error_handler(task, error, raise_exc=True,
38+
+ clean_up=True)
39+
+
40+
if CONF.agent.deploy_logs_collect == 'always':
41+
_store_logs(plugin_data, task.node)
42+
common.clean_up(task, finish=False, always_power_off=True)
43+
diff --git a/releasenotes/notes/agent-inspect-hooks-cleanup-error-c8901a7f8ad0dfd3.yaml b/releasenotes/notes/agent-inspect-hooks-cleanup-error-c8901a7f8ad0dfd3.yaml
44+
new file mode 100644
45+
index 000000000..7ec3e2dd4
46+
--- /dev/null
47+
+++ b/releasenotes/notes/agent-inspect-hooks-cleanup-error-c8901a7f8ad0dfd3.yaml
48+
@@ -0,0 +1,7 @@
49+
+---
50+
+fixes:
51+
+ - |
52+
+ [`Bug 2135265 <https://bugs.launchpad.net/ironic/+bug/2135265>`_]
53+
+ Fixes an issue where an exception in one of the inspection hooks when
54+
+ using the agent inspector interface would result in the node not being
55+
+ cleaned up.
56+
--
57+
2.51.2

containers/ironic/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
0001-pass-along-physical_network-to-neutron-from-the-bare.patch
22
0001-Solve-IPMI-call-issue-results-in-UTF-8-format-error-.patch
33
0001-fix-use-the-correct-path-to-the-image-when-deep-imag.patch
4+
0001-fix-agent-inspection-hooks-failure-does-not-clean-up.patch

0 commit comments

Comments
 (0)