diff --git a/oslo_cache/backends/etcd3gw.py b/oslo_cache/backends/etcd3gw.py index 8168ec9d..05b1f8e9 100644 --- a/oslo_cache/backends/etcd3gw.py +++ b/oslo_cache/backends/etcd3gw.py @@ -14,7 +14,6 @@ """dogpile.cache backend that uses etcd 3.x for storage""" from dogpile.cache import api -import etcd3gw from oslo_cache import core from oslo_serialization import jsonutils @@ -40,6 +39,8 @@ class Etcd3gwCacheBackend(api.CacheBackend): self.host = arguments.get('host', self.DEFAULT_HOST) self.port = arguments.get('port', self.DEFAULT_PORT) self.timeout = int(arguments.get('timeout', self.DEFAULT_TIMEOUT)) + # module etcd3gw is only required when etcd3gw backend is used + import etcd3gw self._client = etcd3gw.client(host=self.host, port=self.port, timeout=self.timeout)