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
This commit is contained in:
Zhenguo Niu 2016-07-20 10:56:33 +08:00
parent 4735ab87f3
commit 7b29eaf4a2

View File

@ -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)