ipaserver/plugins/cert.py: Added reason to raise of errors.NotFound

In the case that enabledService is not found ipaConfigString kdc entry, a
NotFound error was raised without setting the reason. This resulted in a
traceback.

Fixes: https://pagure.io/freeipa/issue/7652
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Thomas Woerner 2018-07-27 12:15:17 +02:00
parent 8edde14e56
commit 71ba408d61

View File

@ -301,7 +301,8 @@ def ca_kdc_check(api_instance, hostname):
ipaconfigstring = {val.lower() for val in kdc_entry['ipaConfigString']}
if 'enabledservice' not in ipaconfigstring:
raise errors.NotFound()
raise errors.NotFound(
reason=_("enabledService not in ipaConfigString kdc entry"))
except errors.NotFound:
raise errors.ACIError(