diff --git a/oslo_cache/backends/etcd3gw.py b/oslo_cache/backends/etcd3gw.py index aac16d58..89db5696 100644 --- a/oslo_cache/backends/etcd3gw.py +++ b/oslo_cache/backends/etcd3gw.py @@ -17,9 +17,9 @@ from __future__ import absolute_import from dogpile.cache import api import etcd3gw -import json from oslo_cache import core +from oslo_serialization import jsonutils __all__ = [ 'Etcd3gwCacheBackend' @@ -50,7 +50,7 @@ class Etcd3gwCacheBackend(api.CacheBackend): values = self._client.get(key, False) if not values: return core.NO_VALUE - value, metadata = json.loads(values[0]) + value, metadata = jsonutils.loads(values[0]) return api.CachedValue(value, metadata) def get_multi(self, keys): @@ -65,7 +65,7 @@ class Etcd3gwCacheBackend(api.CacheBackend): if self.timeout: lease = self._client.lease(ttl=self.timeout) for key, value in mapping.items(): - self._client.put(key, json.dumps(value), lease) + self._client.put(key, jsonutils.dumps(value), lease) def delete(self, key): self._client.delete(key) diff --git a/oslo_cache/core.py b/oslo_cache/core.py index 5b7dcfad..384e42f6 100644 --- a/oslo_cache/core.py +++ b/oslo_cache/core.py @@ -129,8 +129,8 @@ def _build_cache_config(conf): # directly makes for odd behaviors when wrapping dogpile.cache in # a library like oslo.cache if (conf.cache.backend - in ('dogpile.cache.memcached', 'oslo_cache.memcache_pool') - and argname == 'url'): + in ('dogpile.cache.memcached', 'oslo_cache.memcache_pool') and + argname == 'url'): argvalue = argvalue.split(',') conf_dict[arg_key] = argvalue diff --git a/test-requirements.txt b/test-requirements.txt index 0fc85177..a9e9f99b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 pifpaf>=0.10.0 # Apache-2.0