diff --git a/ironic_inspector/conf/default.py b/ironic_inspector/conf/default.py index 5c7c75a97..611a707a9 100644 --- a/ironic_inspector/conf/default.py +++ b/ironic_inspector/conf/default.py @@ -31,6 +31,9 @@ _OPTS = [ 'options. "noauth" will disable all authentication.')), cfg.IntOpt('timeout', default=3600, + # We're using timedelta which can overflow if somebody sets this + # too high, so limit to a sane value of 10 years. + max=315576000, help=_('Timeout after which introspection is considered ' 'failed, set to 0 to disable.')), cfg.IntOpt('node_status_keep_time', diff --git a/ironic_inspector/wsgi_service.py b/ironic_inspector/wsgi_service.py index 33fc40754..21efdbc4b 100644 --- a/ironic_inspector/wsgi_service.py +++ b/ironic_inspector/wsgi_service.py @@ -216,10 +216,14 @@ def periodic_clean_up(): # pragma: no cover try: if node_cache.clean_up(): pxe_filter.driver().sync(ir_utils.get_client()) - sync_with_ironic() except Exception: LOG.exception('Periodic clean up of node cache failed') + try: + sync_with_ironic() + except Exception: + LOG.exception('Periodic sync of node list with ironic failed') + def sync_with_ironic(): ironic = ir_utils.get_client()