Ignore connection errors when getting ironic ports

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
This commit is contained in:
Pavlo Shchelokovskyy 2021-11-23 16:32:01 +02:00 committed by Pavlo Shchelokovskyy
parent 9a1123dad0
commit d14cd501d7
2 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import fcntl
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
@ -90,7 +91,7 @@ class DnsmasqFilter(pxe_filter.BaseFilter):
# 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

View File

@ -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
@ -118,7 +119,7 @@ class IptablesFilter(pxe_filter.BaseFilter):
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")