From d51723fa64c3c402ee9a2f5ae83e45775982c471 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 7 Feb 2024 23:34:32 +0900 Subject: [PATCH] Drop fallback to DEFAULT section The fallback was added 9 years ago, in 0.1.0 release[1]. [1] c98d5edc44ad44da7196afa4b6bba0a2afea1f8e Change-Id: I3b66c5f9df58eaeea9fc51a6c0b83af2e39a525b --- oslo_concurrency/lockutils.py | 6 ++---- oslo_concurrency/tests/unit/test_lockutils.py | 13 ------------- ...ve-defaut-section-fallback-a90a6d2fd10671bc.yaml | 8 ++++++++ 3 files changed, 10 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/remove-defaut-section-fallback-a90a6d2fd10671bc.yaml diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py index 8ca6d1a..b0ffaee 100644 --- a/oslo_concurrency/lockutils.py +++ b/oslo_concurrency/lockutils.py @@ -46,16 +46,14 @@ LOG = logging.getLogger(__name__) _opts = [ cfg.BoolOpt('disable_process_locking', default=False, - help='Enables or disables inter-process locks.', - deprecated_group='DEFAULT'), + help='Enables or disables inter-process locks.'), cfg.StrOpt('lock_path', default=os.environ.get("OSLO_LOCK_PATH"), help='Directory to use for lock files. For security, the ' 'specified directory should only be writable by the user ' 'running the processes that need locking. ' 'Defaults to environment variable OSLO_LOCK_PATH. ' - 'If external locks are used, a lock path must be set.', - deprecated_group='DEFAULT') + 'If external locks are used, a lock path must be set.') ] diff --git a/oslo_concurrency/tests/unit/test_lockutils.py b/oslo_concurrency/tests/unit/test_lockutils.py index 4452467..ad312d2 100644 --- a/oslo_concurrency/tests/unit/test_lockutils.py +++ b/oslo_concurrency/tests/unit/test_lockutils.py @@ -24,7 +24,6 @@ import threading import time from unittest import mock -from oslo_config import cfg from oslotest import base as test_base from oslo_concurrency.fixture import lockutils as fixtures @@ -361,18 +360,6 @@ class LockTestCase(test_base.BaseTestCase): with lockutils.lock("foobar"): pass - def test_deprecated_names(self): - paths = self.create_tempfiles([['fake.conf', '\n'.join([ - '[DEFAULT]', - 'lock_path=foo', - 'disable_process_locking=True']) - ]]) - conf = cfg.ConfigOpts() - conf(['--config-file', paths[0]]) - conf.register_opts(lockutils._opts, 'oslo_concurrency') - self.assertEqual('foo', conf.oslo_concurrency.lock_path) - self.assertTrue(conf.oslo_concurrency.disable_process_locking) - class FileBasedLockingTestCase(test_base.BaseTestCase): def setUp(self): diff --git a/releasenotes/notes/remove-defaut-section-fallback-a90a6d2fd10671bc.yaml b/releasenotes/notes/remove-defaut-section-fallback-a90a6d2fd10671bc.yaml new file mode 100644 index 0000000..1dd27d5 --- /dev/null +++ b/releasenotes/notes/remove-defaut-section-fallback-a90a6d2fd10671bc.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The following options are no longer loaded from the ``[DEFAULT] section``. + Set these options in the ``[oslo_concurrency]`` section. + + - ``disable_process_locking`` + - ``lock_path``