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:
Steve Martinelli 2015-07-01 03:13:02 +00:00
parent 008af8e68d
commit 38a6e14d80
2 changed files with 7 additions and 7 deletions

View File

@ -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.

View File

@ -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'