From 7b29eaf4a2ed9e53686afc7b6c47ead12e4988f3 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Wed, 20 Jul 2016 10:56:33 +0800 Subject: [PATCH] Fix improperly placed firewall.update_filters when aborting Currently, firewall.update_filters() is called before introspection finished, which has no effect as it white-lists MAC addresses that are under introspection. Change-Id: I789e39a86dc72470b80167e53f1755b506ca6f44 Closes-Bug: #1548806 --- ironic_inspector/introspect.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ironic_inspector/introspect.py b/ironic_inspector/introspect.py index f819c8f3c..e698298ac 100644 --- a/ironic_inspector/introspect.py +++ b/ironic_inspector/introspect.py @@ -201,15 +201,6 @@ def _abort(node_info, ironic): node_info.release_lock() return - # block this node from PXE Booting the introspection image - try: - firewall.update_filters(ironic) - except Exception as exc: - # Note(mkovacik): this will be retried in firewall update - # periodic task; we continue aborting - LOG.warning(_LW('Failed to update firewall filters: %s'), exc, - node_info=node_info) - # finish the introspection LOG.debug('Forcing power-off', node_info=node_info) try: @@ -219,4 +210,13 @@ def _abort(node_info, ironic): node_info=node_info) node_info.finished(error=_('Canceled by operator')) + + # block this node from PXE Booting the introspection image + try: + firewall.update_filters(ironic) + except Exception as exc: + # Note(mkovacik): this will be retried in firewall update + # periodic task; we continue aborting + LOG.warning(_LW('Failed to update firewall filters: %s'), exc, + node_info=node_info) LOG.info(_LI('Introspection aborted'), node_info=node_info)