swap the order of conf for a function
all the other functions specify conf as the first parameter, we should be consistent. Change-Id: I3eeaf26be814ce8f27d40f0471f96ab8bf7cbb22
This commit is contained in:
parent
008af8e68d
commit
38a6e14d80
@ -140,16 +140,16 @@ def _sha1_mangle_key(key):
|
|||||||
return util.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.
|
"""Configure a cache region.
|
||||||
|
|
||||||
If the cache region is already configured, this function does nothing.
|
If the cache region is already configured, this function does nothing.
|
||||||
Otherwise, the region is configured.
|
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.
|
:param conf: config object, must have had :func:`configure` called on it.
|
||||||
:type conf: oslo_config.cfg.ConfigOpts
|
: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
|
:raises oslo_cache.exception.ConfigurationError: If the region parameter is
|
||||||
not a dogpile.cache.CacheRegion.
|
not a dogpile.cache.CacheRegion.
|
||||||
:returns: The region.
|
:returns: The region.
|
||||||
|
@ -95,7 +95,7 @@ class CacheRegionTest(BaseTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(CacheRegionTest, self).setUp()
|
super(CacheRegionTest, self).setUp()
|
||||||
self.region = cache._make_region()
|
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.region.wrap(TestProxy)
|
||||||
self.test_value = TestProxyValue('Decorator Test')
|
self.test_value = TestProxyValue('Decorator Test')
|
||||||
|
|
||||||
@ -130,8 +130,8 @@ class CacheRegionTest(BaseTestCase):
|
|||||||
|
|
||||||
def test_cache_region_no_error_multiple_config(self):
|
def test_cache_region_no_error_multiple_config(self):
|
||||||
# Verify configuring the CacheRegion again doesn't error.
|
# Verify configuring the CacheRegion again doesn't error.
|
||||||
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.region, self.config_fixture.conf)
|
cache.configure_cache_region(self.config_fixture.conf, self.region)
|
||||||
|
|
||||||
def _get_cache_fallthrough_fn(self, cache_time):
|
def _get_cache_fallthrough_fn(self, cache_time):
|
||||||
with mock.patch.object(cache.REGION, 'cache_on_arguments',
|
with mock.patch.object(cache.REGION, 'cache_on_arguments',
|
||||||
@ -347,7 +347,7 @@ class CacheNoopBackendTest(BaseTestCase):
|
|||||||
backend='oslo_cache.noop')
|
backend='oslo_cache.noop')
|
||||||
|
|
||||||
self.region = cache._make_region()
|
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):
|
def test_noop_backend(self):
|
||||||
single_value = 'Test Value'
|
single_value = 'Test Value'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user