On 08/28/2013 01:22 PM, Rob Crittenden wrote:
Tomas Babej wrote:
Hi,

When adding a trust using trust-add with misconfigured DNS,
an improper LDAP entry might be returned. Log a proper error
message.

https://fedorahosted.org/freeipa/ticket/3690

I think this should this include which KeyError was raised to help diagnose the problem.

rob

Fixed and rebased on top of current head.

--
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org

From 1aafcd1c800806d92a2df996d6115aef63ddbb1b Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 6 Aug 2013 12:15:22 +0200
Subject: [PATCH] Log proper error message when defaultNamingContext not found

---
 ipaserver/dcerpc.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 4b87a9e8c8e4a7e6433ab9f9f0dffb5dd82cdfd4..a27a64d2f5ba7932c1f44405cc3cf4fb7c8256d2 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -790,9 +790,15 @@ class TrustDomainInstance(object):
             root_logger.error(
                 "LDAP error when connecting to %(host)s: %(error)s" %
                     dict(host=unicode(result.pdc_name), error=str(e)))
+        except KeyError, e:
+            root_logger.error("KeyError: {err}, LDAP entry from {host} "
+                              "returned malformed. Your DNS might be "
+                              "misconfigured."
+                              .format(host=unicode(result.pdc_name),
+                                      err=unicode(e)))
 
         if search_result:
-           self.info['sid'] = self.parse_naming_context(search_result)
+            self.info['sid'] = self.parse_naming_context(search_result)
         return True
 
     def parse_naming_context(self, context):
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to