diff --git a/oslo_cache/core.py b/oslo_cache/core.py index 0374e533..4e1ade0d 100644 --- a/oslo_cache/core.py +++ b/oslo_cache/core.py @@ -140,16 +140,16 @@ def _sha1_mangle_key(key): return util.sha1_mangle_key(key) -def configure_cache_region(region, conf): +def configure_cache_region(conf, region): """Configure a cache region. If the cache region is already configured, this function does nothing. Otherwise, the region is configured. - :param region: Cache region to configure - :type region: dogpile.cache.CacheRegion :param conf: config object, must have had :func:`configure` called on it. :type conf: oslo_config.cfg.ConfigOpts + :param region: Cache region to configure + :type region: dogpile.cache.CacheRegion :raises oslo_cache.exception.ConfigurationError: If the region parameter is not a dogpile.cache.CacheRegion. :returns: The region. diff --git a/oslo_cache/tests/test_cache.py b/oslo_cache/tests/test_cache.py index a9b88d7b..89c9227e 100644 --- a/oslo_cache/tests/test_cache.py +++ b/oslo_cache/tests/test_cache.py @@ -95,7 +95,7 @@ class CacheRegionTest(BaseTestCase): def setUp(self): super(CacheRegionTest, self).setUp() self.region = cache._make_region() - cache.configure_cache_region(self.region, self.config_fixture.conf) + cache.configure_cache_region(self.config_fixture.conf, self.region) self.region.wrap(TestProxy) self.test_value = TestProxyValue('Decorator Test') @@ -130,8 +130,8 @@ class CacheRegionTest(BaseTestCase): def test_cache_region_no_error_multiple_config(self): # Verify configuring the CacheRegion again doesn't error. - cache.configure_cache_region(self.region, self.config_fixture.conf) - cache.configure_cache_region(self.region, self.config_fixture.conf) + cache.configure_cache_region(self.config_fixture.conf, self.region) + cache.configure_cache_region(self.config_fixture.conf, self.region) def _get_cache_fallthrough_fn(self, cache_time): with mock.patch.object(cache.REGION, 'cache_on_arguments', @@ -347,7 +347,7 @@ class CacheNoopBackendTest(BaseTestCase): backend='oslo_cache.noop') self.region = cache._make_region() - cache.configure_cache_region(self.region, self.config_fixture.conf) + cache.configure_cache_region(self.config_fixture.conf, self.region) def test_noop_backend(self): single_value = 'Test Value'