Katello 2.3 add host api changes?

Hi, All,

I have upgraded katello to 2.3 and it got some error while adding host
through host add api, here is the errors:

Traceback (most recent call last):
File "./apitool", line 114, in <module>
main()
File "./apitool", line 96, in main
f.foremanAddHost()
File "/home/sxin/systemutil/hosttool/HostTool/ForemanApi.py", line 94, in
foremanAddHost
returnData = json.loads(buffer.getvalue())
File "/usr/lib64/python2.6/json/init.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

it works well on katello 2.2, and katello api documents was not available
now, it link is broken when I tried to access the api documents. it prompt
the following in the browser:
Not Found

The requested URL /docs/2.3/api/apidoc/v2.en.html was not found on this
server.

··· ------------------------------ Apache/2.2.15 (Red Hat) Server at www.katello.org Port 80

OK, I found the problem, while on 2.2, the api allows to be called through
http, but on 2.3, it will redirect to https.

··· On Monday, November 30, 2015 at 4:41:36 PM UTC+8, sinux shen wrote: > > Hi, All, > > I have upgraded katello to 2.3 and it got some error while adding host > through host add api, here is the errors: > > Traceback (most recent call last): > File "./apitool", line 114, in > main() > File "./apitool", line 96, in main > f.foremanAddHost() > File "/home/sxin/systemutil/hosttool/HostTool/ForemanApi.py", line 94, > in foremanAddHost > returnData = json.loads(buffer.getvalue()) > File "/usr/lib64/python2.6/json/__init__.py", line 307, in loads > return _default_decoder.decode(s) > File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode > obj, end = self.raw_decode(s, idx=_w(s, 0).end()) > File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode > raise ValueError("No JSON object could be decoded") > ValueError: No JSON object could be decoded > > > it works well on katello 2.2, and katello api documents was not available > now, it link is broken when I tried to access the api documents. it prompt > the following in the browser: > Not Found > > The requested URL /docs/2.3/api/apidoc/v2.en.html was not found on this > server. > ------------------------------ > Apache/2.2.15 (Red Hat) Server at www.katello.org Port 80 >