diff --git a/keystone/common/cache/core.py b/keystone/common/cache/core.py index f66b7037bd..7703652f6f 100644 --- a/keystone/common/cache/core.py +++ b/keystone/common/cache/core.py @@ -118,7 +118,7 @@ def configure_cache_region(region): raise exception.ValidationError( _('region not type dogpile.cache.CacheRegion')) - if 'backend' not in region.__dict__: + if not region.is_configured: # NOTE(morganfainberg): this is how you tell if a region is configured. # There is a request logged with dogpile.cache upstream to make this # easier / less ugly. diff --git a/keystone/tests/ksfixtures/cache.py b/keystone/tests/ksfixtures/cache.py index cb5f126929..74566f1ebc 100644 --- a/keystone/tests/ksfixtures/cache.py +++ b/keystone/tests/ksfixtures/cache.py @@ -29,7 +29,7 @@ class Cache(fixtures.Fixture): # NOTE(morganfainberg): The only way to reconfigure the CacheRegion # object on each setUp() call is to remove the .backend property. - if hasattr(cache.REGION, 'backend'): + if cache.REGION.is_configured: del cache.REGION.backend # ensure the cache region instance is setup