From 2a4079eeb6e881a446082462f369173c6b97a1c7 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 2 Sep 2014 13:17:47 -0500 Subject: [PATCH 1/2] Update format fields to work with python2.6 --- lib/ansible/cache/memcached.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/cache/memcached.py b/lib/ansible/cache/memcached.py index bd3730d280..1463d581ca 100644 --- a/lib/ansible/cache/memcached.py +++ b/lib/ansible/cache/memcached.py @@ -150,7 +150,7 @@ class CacheModule(BaseCacheModule): self._keys = CacheModuleKeys(self._cache, self._cache.get(CacheModuleKeys.PREFIX) or []) def _make_key(self, key): - return "{}{}".format(self._prefix, key) + return "{0}{1}".format(self._prefix, key) def _expire_keys(self): if self._timeout > 0: From 9bc9145abd32189bea2b2d5c167ce36ef0384ba9 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 2 Sep 2014 13:19:37 -0500 Subject: [PATCH 2/2] Compress all data inserted into memcached to avoid memcached size limits --- lib/ansible/cache/memcached.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/cache/memcached.py b/lib/ansible/cache/memcached.py index 1463d581ca..35c6d9970e 100644 --- a/lib/ansible/cache/memcached.py +++ b/lib/ansible/cache/memcached.py @@ -168,7 +168,7 @@ class CacheModule(BaseCacheModule): return value def set(self, key, value): - self._cache.set(self._make_key(key), value, time=self._timeout) + self._cache.set(self._make_key(key), value, time=self._timeout, min_compress_len=1) self._keys.add(key) def keys(self):