Restore json import for redis as well. Switch preference to simplejson for speed
This commit is contained in:
parent
ec2fc3adf8
commit
5ed7a55990
3 changed files with 10 additions and 5 deletions
4
lib/ansible/cache/jsonfile.py
vendored
4
lib/ansible/cache/jsonfile.py
vendored
|
@ -20,9 +20,9 @@ import time
|
|||
import errno
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible import utils
|
||||
|
|
5
lib/ansible/cache/redis.py
vendored
5
lib/ansible/cache/redis.py
vendored
|
@ -21,6 +21,11 @@ import collections
|
|||
import sys
|
||||
import time
|
||||
|
||||
try:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.utils import jsonify
|
||||
from ansible.cache.base import BaseCacheModule
|
||||
|
|
|
@ -45,7 +45,6 @@ import warnings
|
|||
import traceback
|
||||
import getpass
|
||||
import sys
|
||||
import json
|
||||
import subprocess
|
||||
import contextlib
|
||||
|
||||
|
@ -63,9 +62,10 @@ CODE_REGEX = re.compile(r'(?:{%|%})')
|
|||
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
# simplejson can be much faster if it's available
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
# Note, sha1 is the only hash algorithm compatible with python2.4 and with
|
||||
# FIPS-140 mode (as of 11-2014)
|
||||
|
|
Loading…
Reference in a new issue