Skip to content

Commit

Permalink
Ignore connection errors when getting ironic ports
Browse files Browse the repository at this point in the history
as a followup to I24b08612c4ffc6aca60ca08f3ff5cc769c7c041d,
this solves the case when connectivity between inspector and ironic is
broken, which can lead to the same FSM being stuck in uninitialized mode
it can't get out of w/o restart.

Change-Id: Ie238a2fca7cc5ef4961c0cb0e639ffbbe69556f7
Story: #2008971
Task: #42611
  • Loading branch information
pshchelo committed Jul 15, 2022
1 parent 9a1123d commit d14cd50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ironic_inspector/pxe_filter/dnsmasq.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import os
import time

from keystoneauth1 import exceptions as ksa_exc
from openstack import exceptions as os_exc
from oslo_concurrency import processutils
from oslo_config import cfg
Expand Down Expand Up @@ -90,7 +91,7 @@ def _sync(self, ironic):

# ironic_macs are all the MACs know to ironic (all ironic ports)
ironic_macs = pxe_filter.get_ironic_macs(ironic)
except os_exc.SDKException:
except (os_exc.SDKException, ksa_exc.ConnectFailure):
LOG.exception(
"Could not list ironic ports, can not sync dnsmasq PXE filter")
return
Expand Down
3 changes: 2 additions & 1 deletion ironic_inspector/pxe_filter/iptables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import contextlib

from keystoneauth1 import exceptions as ksa_exc
from openstack import exceptions as os_exc
from oslo_concurrency import processutils
from oslo_config import cfg
Expand Down Expand Up @@ -118,7 +119,7 @@ def sync(self, ironic):
else:
to_deny = pxe_filter.get_inactive_macs(ironic)
to_allow = None
except os_exc.SDKException:
except (os_exc.SDKException, ksa_exc.ConnectFailure):
LOG.exception(
"Could not list ironic ports, iptables PXE filter can not "
"be synced")
Expand Down

0 comments on commit d14cd50

Please sign in to comment.