Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

get_a_record ValueError: No JSON object could be decoded #41

Open
seph3 opened this issue Jan 9, 2018 · 0 comments
Open

get_a_record ValueError: No JSON object could be decoded #41

seph3 opened this issue Jan 9, 2018 · 0 comments

Comments

@seph3
Copy link

seph3 commented Jan 9, 2018

Environment:
Infoblox WAPI 2.6.1
ansible-playbook 2.4.2.0
python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

For bypass https certificate validation I modified the inflobox.py:

182 try:
183     import requests
184 #    requests.packages.urllib3.disable_warnings()
185     HAS_REQUESTS = True
186 except ImportError:
187     HAS_REQUESTS = False
188
189 import urllib3
190 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Now I receive a error when try to get_a_record

The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 2207, in
main()
File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 1814, in main
result = infoblox.get_a_record(name)
File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 526, in get_a_record
return self.invoke("get", "record:a", params=params)
File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 226, in invoke
raise Exception(response.json())
File "/usr/lib/python2.7/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 2207, in \n main()\n File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 1814, in main\n result = infoblox.get_a_record(name)\n File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 526, in get_a_record\n return self.invoke("get", "record:a", params=params)\n File "/tmp/ansible_oSwHTl/ansible_module_infoblox.py", line 226, in invoke\n raise Exception(response.json())\n File "/usr/lib/python2.7/site-packages/requests/models.py", line 892, in json\n return complexjson.loads(self.text, **kwargs)\n File "/usr/lib64/python2.7/json/init.py", line 338, in loads\n return _default_decoder.decode(s)\n File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode\n raise ValueError("No JSON object could be decoded")\nValueError: No JSON object could be decoded\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant