print('{"msg": "Error: ansible requires the stdlib json or simplejson module, neither was found!", "failed": true}')
print('\n{"msg": "Error: ansible requires the stdlib json or simplejson module, neither was found!", "failed": true}')
sys.exit(1)
sys.exit(1)
exceptSyntaxError:
exceptSyntaxError:
print('{"msg": "SyntaxError: probably due to installed simplejson being for a different python version", "failed": true}')
print('\n{"msg": "SyntaxError: probably due to installed simplejson being for a different python version", "failed": true}')
sys.exit(1)
sys.exit(1)
HAVE_SELINUX=False
HAVE_SELINUX=False
@ -574,7 +574,7 @@ class AnsibleModule(object):
exceptException:
exceptException:
e=get_exception()
e=get_exception()
# Use exceptions here because it isn't safe to call fail_json until no_log is processed
# Use exceptions here because it isn't safe to call fail_json until no_log is processed
print('{"failed": true, "msg": "Module alias error: %s"}'%str(e))
print('\n{"failed": true, "msg": "Module alias error: %s"}'%str(e))
sys.exit(1)
sys.exit(1)
# Save parameter values that should never be logged
# Save parameter values that should never be logged
@ -1497,7 +1497,7 @@ class AnsibleModule(object):
params=json.loads(buffer.decode('utf-8'))
params=json.loads(buffer.decode('utf-8'))
exceptValueError:
exceptValueError:
# This helper used too early for fail_json to work.
# This helper used too early for fail_json to work.
print('{"msg": "Error: Module unable to decode valid JSON on stdin. Unable to figure out what parameters were passed", "failed": true}')
print('\n{"msg": "Error: Module unable to decode valid JSON on stdin. Unable to figure out what parameters were passed", "failed": true}')
sys.exit(1)
sys.exit(1)
ifsys.version_info<(3,):
ifsys.version_info<(3,):
@ -1508,7 +1508,7 @@ class AnsibleModule(object):
self.constants=params['ANSIBLE_MODULE_CONSTANTS']
self.constants=params['ANSIBLE_MODULE_CONSTANTS']
exceptKeyError:
exceptKeyError:
# This helper used too early for fail_json to work.
# This helper used too early for fail_json to work.
print('{"msg": "Error: Module unable to locate ANSIBLE_MODULE_ARGS and ANSIBLE_MODULE_CONSTANTS in json data from stdin. Unable to figure out what parameters were passed", "failed": true}')
print('\n{"msg": "Error: Module unable to locate ANSIBLE_MODULE_ARGS and ANSIBLE_MODULE_CONSTANTS in json data from stdin. Unable to figure out what parameters were passed", "failed": true}')