ironic/ironic/conf/drac.py
Ruby Loo f39aae0c95 Disable periodic tasks if interval set to 0
For periodic tasks that are specified with the decorator @perodics.periodic(),
a ValueError exception was raised if a value <= 0 was specified for any of the
spacing values (taken from configuration options).

Specifying a value <=0 used to work, to disable the task altogether. It broke
when we switched to using the futurist package (some time in mitaka cycle).

This fixes it so that setting these configuration options to 0 (or a negative
value) will disable the periodic tasks:
- [conductor]sync_power_state_interval: sync power states for the nodes
- [conductor]check_provision_state_interval:
  - check deployments and time out if the deployment takes too long
  - check the status of cleaning a node and time out if it takes too long
  - check the status of inspecting a node and time out if it takes too long
  - check for and handle nodes that are taken over by new conductors (if an
    old conductor disappeared)
- [conductor]send_sensor_data_interval: send sensor data to ceilometer
- [conductor]sync_local_state_interval: refresh a conductor's copy of the
  consistent hash ring. If any mappings have changed, determines which,
  if any, nodes need to be "taken over". The ensuing actions could include
  preparing a PXE environment, updating the DHCP server, and so on.
- [oneview]periodic_check_interval:
  - check for nodes taken over by OneView users
  - check for nodes freed by OneView users

Change-Id: I62708e239295344d0dcf0bff7dd68ec8c34ab9a0
Story: #2002059
Task: #19708
2018-08-14 01:19:02 +00:00

30 lines
1.0 KiB
Python

#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from ironic.common.i18n import _
opts = [
cfg.IntOpt('query_raid_config_job_status_interval',
default=120,
min=1,
help=_('Interval (in seconds) between periodic RAID job status '
'checks to determine whether the asynchronous RAID '
'configuration was successfully finished or not.'))
]
def register_opts(conf):
conf.register_opts(opts, group='drac')