|
|
|
@ -70,14 +70,21 @@ from itertools import imap, repeat
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
import json
|
|
|
|
|
# Detect the python-json library which is incompatible
|
|
|
|
|
# Look for simplejson if that's the case
|
|
|
|
|
try:
|
|
|
|
|
if not isinstance(json.loads, types.FunctionType) or not isinstance(json.dumps, types.FunctionType):
|
|
|
|
|
raise ImportError
|
|
|
|
|
except AttributeError:
|
|
|
|
|
raise ImportError
|
|
|
|
|
except ImportError:
|
|
|
|
|
try:
|
|
|
|
|
import simplejson as json
|
|
|
|
|
except ImportError:
|
|
|
|
|
sys.stderr.write('Error: ansible requires a json module, none found!')
|
|
|
|
|
print('{"msg": "Error: ansible requires the stdlib json or simplejson module, neither was found!", "failed": true}')
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
except SyntaxError:
|
|
|
|
|
sys.stderr.write('SyntaxError: probably due to json and python being for different versions')
|
|
|
|
|
print('{"msg": "SyntaxError: probably due to installed simplejson being for a different python version", "failed": true}')
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
HAVE_SELINUX=False
|
|
|
|
|