Silent fail when kerberos module not installed
If the kerberos
module is not installed, the shared freeipa client silently fails to initialize. This is due to this snippet in the enter() method of freeipa_client Client:
if not self.logged_in:
try:
if len(self._login_args) > 0:
self._client.login(*self._login_args)
else:
self._client.login_kerberos()
self._logged_in = True
except Exception as e:
self._login_exception = e
self._logged_in = False
The blanket catch catches the ImportError that is raised by requests_kerberos if the kerberos
module is absent.
We should probably fail more explicitly if kerberos is absent, as it's required for the forgot password function.