diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 0da00053a0..fbd1cdf468 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1240,7 +1240,10 @@ class AnsibleModule(object): def _load_params(self): ''' read the input and return a dictionary and the arguments string ''' - params = json_dict_unicode_to_bytes(json.loads(MODULE_COMPLEX_ARGS)) + params = json.loads(MODULE_COMPLEX_ARGS) + if str is bytes: + # Python 2 + params = json_dict_unicode_to_bytes(params) if params is None: params = dict() return params