diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py index bcb28f5c93..b960336416 100644 --- a/ironic/conductor/manager.py +++ b/ironic/conductor/manager.py @@ -1599,7 +1599,7 @@ class ConductorManager(base_manager.BaseConductorManager): @periodics.periodic( spacing=CONF.conductor.check_provision_state_interval, enabled=CONF.conductor.check_provision_state_interval > 0 - and CONF.conductor.deploy_callback_timeout != 0) + and CONF.conductor.deploy_callback_timeout > 0) def _check_deploy_timeouts(self, context): """Periodically checks whether a deploy RPC call has timed out. @@ -1607,8 +1607,6 @@ class ConductorManager(base_manager.BaseConductorManager): :param context: request context. """ - # FIXME(rloo): If the value is < 0, it will be enabled. That doesn't - # seem right. callback_timeout = CONF.conductor.deploy_callback_timeout filters = {'reserved': False, @@ -1821,7 +1819,7 @@ class ConductorManager(base_manager.BaseConductorManager): @periodics.periodic( spacing=CONF.conductor.check_provision_state_interval, enabled=CONF.conductor.check_provision_state_interval > 0 - and CONF.conductor.clean_callback_timeout != 0) + and CONF.conductor.clean_callback_timeout > 0) def _check_cleanwait_timeouts(self, context): """Periodically checks for nodes being cleaned. @@ -1830,8 +1828,6 @@ class ConductorManager(base_manager.BaseConductorManager): :param context: request context. """ - # FIXME(rloo): If the value is < 0, it will be enabled. That doesn't - # seem right. callback_timeout = CONF.conductor.clean_callback_timeout filters = {'reserved': False, @@ -2982,15 +2978,13 @@ class ConductorManager(base_manager.BaseConductorManager): @periodics.periodic( spacing=CONF.conductor.check_provision_state_interval, enabled=CONF.conductor.check_provision_state_interval > 0 - and CONF.conductor.inspect_wait_timeout != 0) + and CONF.conductor.inspect_wait_timeout > 0) def _check_inspect_wait_timeouts(self, context): """Periodically checks inspect_wait_timeout and fails upon reaching it. :param context: request context """ - # FIXME(rloo): If the value is < 0, it will be enabled. That doesn't - # seem right. callback_timeout = CONF.conductor.inspect_wait_timeout filters = {'reserved': False, diff --git a/ironic/conf/conductor.py b/ironic/conf/conductor.py index 63c607e3b3..494317f8d2 100644 --- a/ironic/conf/conductor.py +++ b/ironic/conf/conductor.py @@ -60,6 +60,7 @@ opts = [ 'in seconds. Set to 0 to disable checks.')), cfg.IntOpt('deploy_callback_timeout', default=1800, + min=0, help=_('Timeout (seconds) to wait for a callback from ' 'a deploy ramdisk. Set to 0 to disable timeout.')), cfg.BoolOpt('force_power_state_during_sync', @@ -149,6 +150,7 @@ opts = [ 'configdrive_use_object_store is True.')), cfg.IntOpt('inspect_wait_timeout', default=1800, + min=0, help=_('Timeout (seconds) for waiting for node inspection. ' '0 - unlimited.')), cfg.BoolOpt('automated_clean', @@ -184,6 +186,7 @@ opts = [ 'maintenance will make the process continue.')), cfg.IntOpt('clean_callback_timeout', default=1800, + min=0, help=_('Timeout (seconds) to wait for a callback from the ' 'ramdisk doing the cleaning. If the timeout is reached ' 'the node will be put in the "clean failed" provision ' diff --git a/releasenotes/notes/disable_periodic_task-590a91c0a5235cfb.yaml b/releasenotes/notes/disable_periodic_task-590a91c0a5235cfb.yaml new file mode 100644 index 0000000000..a613be6651 --- /dev/null +++ b/releasenotes/notes/disable_periodic_task-590a91c0a5235cfb.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixes periodic task initialization options to prevent a negative number. + + If "[conductor]clean_callback_timeout","[conductor]inspect_wait_timeout" + and "[conductor]inspect_wait_timeout" are a negative value will cause an + error on start up from now on. \ No newline at end of file