f65af0
From f49068ecd3484b4898517854b9886bd3b0691691 Mon Sep 17 00:00:00 2001
f65af0
From: Thomas Woerner <twoerner@redhat.com>
f65af0
Date: Fri, 27 Jul 2018 12:15:17 +0200
f65af0
Subject: [PATCH] ipaserver/plugins/cert.py: Added reason to raise of
f65af0
 errors.NotFound
f65af0
f65af0
In the case that enabledService is not found ipaConfigString kdc entry, a
f65af0
NotFound error was raised without setting the reason. This resulted in a
f65af0
traceback.
f65af0
f65af0
Fixes: https://pagure.io/freeipa/issue/7652
f65af0
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f65af0
---
f65af0
 ipaserver/plugins/cert.py | 3 ++-
f65af0
 1 file changed, 2 insertions(+), 1 deletion(-)
f65af0
f65af0
diff --git a/ipaserver/plugins/cert.py b/ipaserver/plugins/cert.py
f65af0
index db624357af189753980927655215b17c06291a15..0663272c9b4fd73225f63fe52d8d31157d5cc690 100644
f65af0
--- a/ipaserver/plugins/cert.py
f65af0
+++ b/ipaserver/plugins/cert.py
f65af0
@@ -301,7 +301,8 @@ def ca_kdc_check(api_instance, hostname):
f65af0
         ipaconfigstring = {val.lower() for val in kdc_entry['ipaConfigString']}
f65af0
 
f65af0
         if 'enabledservice' not in ipaconfigstring:
f65af0
-            raise errors.NotFound()
f65af0
+            raise errors.NotFound(
f65af0
+                reason=_("enabledService not in ipaConfigString kdc entry"))
f65af0
 
f65af0
     except errors.NotFound:
f65af0
         raise errors.ACIError(
f65af0
-- 
f65af0
2.17.1
f65af0