diff options
author | Ben Nemec <bnemec@redhat.com> | 2014-09-26 17:38:04 +0000 |
---|---|---|
committer | Ben Nemec <bnemec@redhat.com> | 2014-09-30 15:03:48 +0000 |
commit | baee4673eb7420bae17e2667162f388d17836924 (patch) | |
tree | 398907fad63ef30a0c7171789e49e480656ce761 | |
parent | 5d1461204d1cce680378d5b7c6c2b17f19b7f4b0 (diff) | |
download | oslo-concurrency-baee4673eb7420bae17e2667162f388d17836924.tar.gz |
Use ConfigFilter for opts
This will prevent them being registered on the global config object
and becoming available to consuming applications.
Change-Id: Ibddb876d18c6aefef9dca08cf5883d8bdca17925
bp graduate-oslo-concurrency
-rw-r--r-- | oslo/concurrency/lockutils.py | 3 | ||||
-rw-r--r-- | tests/unit/test_lockutils.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/oslo/concurrency/lockutils.py b/oslo/concurrency/lockutils.py index 9ccc27c..b8781ab 100644 --- a/oslo/concurrency/lockutils.py +++ b/oslo/concurrency/lockutils.py @@ -27,6 +27,7 @@ import time import weakref from oslo.config import cfg +from oslo.config import cfgfilter from oslo.concurrency._i18n import _, _LE, _LI from oslo.concurrency.openstack.common import fileutils @@ -48,7 +49,7 @@ _opts = [ ] -CONF = cfg.CONF +CONF = cfgfilter.ConfigFilter(cfg.CONF) CONF.register_opts(_opts, group='oslo_concurrency') diff --git a/tests/unit/test_lockutils.py b/tests/unit/test_lockutils.py index 262b831..9419e30 100644 --- a/tests/unit/test_lockutils.py +++ b/tests/unit/test_lockutils.py @@ -34,7 +34,7 @@ class LockTestCase(test_base.BaseTestCase): def setUp(self): super(LockTestCase, self).setUp() - self.config = self.useFixture(config.Config()).config + self.config = self.useFixture(config.Config(lockutils.CONF)).config def test_synchronized_wrapped_function_metadata(self): @lockutils.synchronized('whatever', 'test-') @@ -485,7 +485,7 @@ class TestLockFixture(test_base.BaseTestCase): def setUp(self): super(TestLockFixture, self).setUp() - self.config = self.useFixture(config.Config()).config + self.config = self.useFixture(config.Config(lockutils.CONF)).config self.tempdir = tempfile.mkdtemp() def _check_in_lock(self): |