Index: univention-s4-connector/univention-ad-takeover =================================================================== --- univention-s4-connector/univention-ad-takeover (Revision 46691) +++ univention-s4-connector/univention-ad-takeover (Arbeitskopie) @@ -870,9 +870,10 @@ sys.exit(1) log.debug("output of %s\nstdout: '%s'\nstderr: '%s'" % (cmd, stdout.rstrip(), stderr.rstrip())) - lines = stdout.rstrip('\n').split('\n') - if not stdout: - log.debug("Error: DNS lookup for DC at IP %s failed." % ad_server_ip) + lines = stdout.strip('\n').split('\n') + lines = [line for line in lines if not line.startswith(';')] + if len(lines) == 0: + log.error("Error: DNS lookup for DC at IP %s failed: %s" % (ad_server_ip, stdout)) try: msgs = remote_samdb.search(base="", scope=samba.ldb.SCOPE_BASE, attrs=["defaultNamingContext"]) @@ -888,6 +889,7 @@ else: log.error("Please retry by passing the AD server name as additional command line argument.") else: + log.debug("Remote domain lookup in AD failed as well.") log.error("Please retry by passing the AD server name as additional command line argument.") sys.exit(1) except ldb.LdbError: @@ -962,7 +964,7 @@ log.info("Sucessfull determined AD DC FQDN %s for given IP %s" % (ad_server_fqdn, ad_server_ip)) except: msg = [] - msg.append("Error: Parsing of DNS SRV record failed: '%s'." % lines.rstrip()) + msg.append("Error: Parsing of DNS SRV record failed: '%s'." % lines[0].rstrip()) msg.append("Please retry by passing the AD server name as additional command line argument.") log.error("\n".join(msg)) sys.exit(1)