From f3e27c19161ed4c1c703a1551e2312e3095bf1a8 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 12 May 2020 12:21:20 +0200 Subject: [PATCH] Make POST /v1/introspection synchronous when manage_boot==False Without manage_boot the only real action we do is updating the firewall, which is supposed to be pretty fast. Making the call synchronous means that ironic will receive information about PXE filter failures and will not attempt to power on a failed node or before the PXE filter is updated. Change-Id: I95b63d4e1d4c2c186c0e8234c4382b00aa918aa8 Story: #2007658 Task: #39746 --- ironic_inspector/introspect.py | 7 +++++-- releasenotes/notes/unmanaged-result-4de3788e7820e3c5.yaml | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/unmanaged-result-4de3788e7820e3c5.yaml diff --git a/ironic_inspector/introspect.py b/ironic_inspector/introspect.py index dd5570848..39d2b8ea4 100644 --- a/ironic_inspector/introspect.py +++ b/ironic_inspector/introspect.py @@ -62,7 +62,10 @@ def introspect(node_id, manage_boot=True, token=None): manage_boot=manage_boot, ironic=ironic) - utils.executor().submit(_background_introspect, node_info, ironic) + if manage_boot: + utils.executor().submit(_do_introspect, node_info, ironic) + else: + _do_introspect(node_info, ironic) def _persistent_ramdisk_boot(node): @@ -92,7 +95,7 @@ def _wait_for_turn(node_info): @node_cache.release_lock @node_cache.fsm_transition(istate.Events.wait) -def _background_introspect(node_info, ironic): +def _do_introspect(node_info, ironic): node_info.acquire_lock() # TODO(dtantsur): pagination diff --git a/releasenotes/notes/unmanaged-result-4de3788e7820e3c5.yaml b/releasenotes/notes/unmanaged-result-4de3788e7820e3c5.yaml new file mode 100644 index 000000000..eab7e1757 --- /dev/null +++ b/releasenotes/notes/unmanaged-result-4de3788e7820e3c5.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + The introspection start API is now synchronous when ``manage_boot==False``. + This means that any failures will be propagated to ironic, preventing it + from powering a node on and booting it without the PXE filter updated.