Log proper error message when defaultNamingContext not found

This commit is contained in:
Tomas Babej 2013-08-06 12:15:22 +02:00 committed by Petr Viktorin
parent 7c66912824
commit a3d489443c

View File

@ -790,6 +790,12 @@ class TrustDomainInstance(object):
root_logger.error( root_logger.error(
"LDAP error when connecting to %(host)s: %(error)s" % "LDAP error when connecting to %(host)s: %(error)s" %
dict(host=unicode(result.pdc_name), error=str(e))) 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: if search_result:
self.info['sid'] = self.parse_naming_context(search_result) self.info['sid'] = self.parse_naming_context(search_result)