Closed machalekj closed 8 years ago
Thanks for the fix!
I'll test it on our servers too, do you remember the details of the error you were getting?
Hi, before my patching initialization of foreman.client.Foreman object failed with following traceback:
from foreman.client import Foreman f = Foreman('https://localhost', ('myuser', 'mypass')) ... Traceback (most recent call last): File "
", line 1, in File "foreman/client.py", line 347, in init self.version = self.get_foreman_version() File "foreman/client.py", line 369, in get_foreman_version raise ForemanException(res, 'Something went wrong') foreman.client.ForemanException: Something went wrong
I am using Foreman v1.5.3.
Sorry about the delay
This small change fixes get_foreman_version method by not getting home page with session, which has HTTP headers for accepting just JSON, but instead with requests.get method. This fixed our issue with Foreman class initialization.