diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2014-12-19 20:05:00 -0500 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2014-12-19 20:05:00 -0500 |
commit | ed380136bcd4657b852618bf0c1e471995e5fe79 (patch) | |
tree | a574a1a3238992377ec77f00a431b67e0f96ab9d | |
parent | a55c6625d4771c44017fce1d487b38749b12b381 (diff) | |
download | ansible-ed380136bcd4657b852618bf0c1e471995e5fe79.tar.gz |
removed uneeded and posibly error producing json import
now uses utils.jsonify which does proper utf8 encoding
-rw-r--r-- | lib/ansible/cache/jsonfile.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/ansible/cache/jsonfile.py b/lib/ansible/cache/jsonfile.py index ca18974d3c..a3768209bc 100644 --- a/lib/ansible/cache/jsonfile.py +++ b/lib/ansible/cache/jsonfile.py @@ -17,14 +17,12 @@ import os import time -import json import errno from ansible import constants as C from ansible import utils from ansible.cache.base import BaseCacheModule - class CacheModule(BaseCacheModule): """ A caching module backed by json files. @@ -70,12 +68,11 @@ class CacheModule(BaseCacheModule): cachefile = "%s/%s" % (self._cache_dir, key) try: - #TODO: check if valid keys can have invalid FS chars, base32? f = open(cachefile, 'w') except (OSError,IOError), e: utils.warning("error while trying to read %s : %s" % (cachefile, str(e))) else: - json.dump(value, f, ensure_ascii=False) + f.write(utils.jsonify(value)) finally: f.close() |