Closed pief closed 9 years ago
It gets worse: when supplying an URL with the /api/
part to the Foreman
constructor, get_foreman_version
breaks because it expects the front page's HTML to parse the Foreman version, even if the constructor is called with the api_version
parameter.
It seems to me that the version=2
part causes trouble here?
Where does python-foreman use the url without the api?
Sorry, I should have included code examples for calling python-foreman. However for some reason or another, I can't reproduce the behavior any longer, so I'm closing this.
I noticed that python-foreman's usage of
application/json; version=2
has an influence on Foreman's behavior when using URLs such ashttps://127.0.0.1/
without the/api/
part:This does not happen when one uses newer, "correct" URLs such as "https://127.0.0.1/api/":
While this is, of course, Foreman's behavior and not python-foreman's behavior, python-foreman could (eg. via a regular expression) make sure that the supplied URL contains the
/api/
part.At the very least the documentation should be updated because the current (outdated, but still online) documentation at http://david-caro.github.io/python-foreman/basic.html#connect still refers to using an URL without the
/api/
part, thus possibly irritating new python-foreman users.