mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-10 10:19:10 -07:00
Reverse the error messages from jsonfile get and set
This commit is contained in:
parent
c225290436
commit
79f9fbd50e
1 changed files with 2 additions and 2 deletions
4
lib/ansible/cache/jsonfile.py
vendored
4
lib/ansible/cache/jsonfile.py
vendored
|
@ -60,7 +60,7 @@ class CacheModule(BaseCacheModule):
|
||||||
try:
|
try:
|
||||||
f = codecs.open(cachefile, 'r', encoding='utf-8')
|
f = codecs.open(cachefile, 'r', encoding='utf-8')
|
||||||
except (OSError,IOError), e:
|
except (OSError,IOError), e:
|
||||||
utils.warning("error while trying to write to %s : %s" % (cachefile, str(e)))
|
utils.warning("error while trying to read %s : %s" % (cachefile, str(e)))
|
||||||
else:
|
else:
|
||||||
value = json.load(f)
|
value = json.load(f)
|
||||||
self._cache[key] = value
|
self._cache[key] = value
|
||||||
|
@ -76,7 +76,7 @@ class CacheModule(BaseCacheModule):
|
||||||
try:
|
try:
|
||||||
f = codecs.open(cachefile, 'w', encoding='utf-8')
|
f = codecs.open(cachefile, 'w', encoding='utf-8')
|
||||||
except (OSError,IOError), e:
|
except (OSError,IOError), e:
|
||||||
utils.warning("error while trying to read %s : %s" % (cachefile, str(e)))
|
utils.warning("error while trying to write to %s : %s" % (cachefile, str(e)))
|
||||||
else:
|
else:
|
||||||
f.write(utils.jsonify(value))
|
f.write(utils.jsonify(value))
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue