Clean up deprecated config options

Remove deprecated in ocata options: `introspection_delay_drivers`
and `log_bmc_address`.

Change-Id: I52a7c48609af558cd641d544910be8bce13968a5
This commit is contained in:
Anton Arefiev 2017-08-08 12:19:23 +03:00
parent b4391dec09
commit 8fd9f73a9c
7 changed files with 19 additions and 73 deletions

View File

@ -49,12 +49,6 @@
# Delay (in seconds) between two introspections. (integer value)
#introspection_delay = 5
# DEPRECATED: Only node with drivers matching this regular expression
# will be affected by introspection_delay setting. (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#introspection_delay_drivers = .*
# Ironic driver_info fields that are equivalent to ipmi_address. (list
# value)
#ipmi_address_fields = ilo_address,drac_host,drac_address,cimc_address
@ -779,12 +773,6 @@
# local_gb is calculated on the ramdisk side. (boolean value)
#disk_partitioning_spacing = true
# DEPRECATED: Whether to log node BMC address with every message
# during processing. (boolean value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#log_bmc_address = true
# File name template for storing ramdisk logs. The following
# replacements can be used: {uuid} - node UUID or "unknown", {bmc} -
# node BMC address or "unknown", {dt} - current UTC date and time,

View File

@ -119,11 +119,6 @@ PROCESSING_OPTS = [
'partitioning. Only has effect when used with the IPA '
'as a ramdisk, for older ramdisk local_gb is '
'calculated on the ramdisk side.')),
cfg.BoolOpt('log_bmc_address',
default=True,
help=_('Whether to log node BMC address with every message '
'during processing.'),
deprecated_for_removal=True),
cfg.StrOpt('ramdisk_logs_filename_format',
default='{uuid}_{dt:%Y%m%d-%H%M%S.%f}.tar.gz',
help=_('File name template for storing ramdisk logs. The '
@ -180,12 +175,6 @@ SERVICE_OPTS = [
cfg.IntOpt('introspection_delay',
default=5,
help=_('Delay (in seconds) between two introspections.')),
cfg.StrOpt('introspection_delay_drivers',
default='.*',
help=_('Only node with drivers matching this regular '
'expression will be affected by introspection_delay '
'setting.'),
deprecated_for_removal=True),
cfg.ListOpt('ipmi_address_fields',
default=['ilo_address', 'drac_host', 'drac_address',
'cimc_address'],

View File

@ -13,7 +13,6 @@
"""Handling introspection request."""
import re
import time
from eventlet import semaphore
@ -75,16 +74,15 @@ def introspect(node_id, token=None):
def _background_introspect(ironic, node_info):
global _LAST_INTROSPECTION_TIME
if re.match(CONF.introspection_delay_drivers, node_info.node().driver):
LOG.debug('Attempting to acquire lock on last introspection time')
with _LAST_INTROSPECTION_LOCK:
delay = (_LAST_INTROSPECTION_TIME - time.time()
+ CONF.introspection_delay)
if delay > 0:
LOG.debug('Waiting %d seconds before sending the next '
'node on introspection', delay)
time.sleep(delay)
_LAST_INTROSPECTION_TIME = time.time()
LOG.debug('Attempting to acquire lock on last introspection time')
with _LAST_INTROSPECTION_LOCK:
delay = (_LAST_INTROSPECTION_TIME - time.time()
+ CONF.introspection_delay)
if delay > 0:
LOG.debug('Waiting %d seconds before sending the next '
'node on introspection', delay)
time.sleep(delay)
_LAST_INTROSPECTION_TIME = time.time()
node_info.acquire_lock()
try:

View File

@ -304,29 +304,6 @@ class TestIntrospect(BaseTest):
# updated to the current time.time()
self.assertEqual(100, introspect._LAST_INTROSPECTION_TIME)
@mock.patch.object(time, 'time')
def test_introspection_delay_custom_drivers(
self, time_mock, client_mock, start_mock, filters_mock):
self.node.driver = 'foobar'
time_mock.return_value = 42
introspect._LAST_INTROSPECTION_TIME = 40
CONF.set_override('introspection_delay', 10)
CONF.set_override('introspection_delay_drivers', 'fo{1,2}b.r')
cli = self._prepare(client_mock)
start_mock.return_value = self.node_info
introspect.introspect(self.uuid)
self.sleep_fixture.mock.assert_called_once_with(8)
cli.node.set_boot_device.assert_called_once_with(self.uuid,
'pxe',
persistent=False)
cli.node.set_power_state.assert_called_once_with(self.uuid,
'reboot')
# updated to the current time.time()
self.assertEqual(42, introspect._LAST_INTROSPECTION_TIME)
@mock.patch.object(firewall, 'update_filters', autospec=True)
@mock.patch.object(node_cache, 'get_node', autospec=True)

View File

@ -120,18 +120,6 @@ class TestProcessingLogger(base.BaseTest):
self.assertEqual('[node: NNN state foobar]',
utils.processing_logger_prefix(node_info=node_info))
def test_adapter_no_bmc(self):
CONF.set_override('log_bmc_address', False, 'processing')
node_info = node.Node(mock.Mock(), dict(uuid='NNN'))
data = {'boot_interface': '01-aa-bb-cc-dd-ee-ff',
'inventory': {'bmc_address': '1.2.3.4'}}
logger = utils.getProcessingLogger(__name__)
msg, _kwargs = logger.process('foo', {'node_info': node_info,
'data': data})
self.assertEqual(
'[node: NNN MAC aa:bb:cc:dd:ee:ff] foo',
msg)
def test_adapter_with_bmc(self):
node_info = node.Node(mock.Mock(), dict(uuid='NNN'))
data = {'boot_interface': '01-aa-bb-cc-dd-ee-ff',

View File

@ -72,10 +72,9 @@ def processing_logger_prefix(data=None, node_info=None):
if pxe_mac:
parts.append('MAC %s' % pxe_mac)
if CONF.processing.log_bmc_address:
bmc_address = get_ipmi_address_from_data(data) if data else None
if bmc_address:
parts.append('BMC %s' % bmc_address)
bmc_address = get_ipmi_address_from_data(data) if data else None
if bmc_address:
parts.append('BMC %s' % bmc_address)
if parts:
return _('[node: %s]') % ' '.join(parts)

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Removes deprecated configuration options: ``introspection_delay_drivers``
from the DEFAULT section and ``log_bmc_address`` from the ``processing``
section.