View | Details | Raw Unified | Return to bug 31731
Collapse All | Expand All

(-)univention-s4-connector/univention-ad-takeover (-4 / +6 lines)
 Lines 870-878    Link Here 
870
			sys.exit(1)
870
			sys.exit(1)
871
871
872
		log.debug("output of %s\nstdout: '%s'\nstderr: '%s'" % (cmd, stdout.rstrip(), stderr.rstrip()))
872
		log.debug("output of %s\nstdout: '%s'\nstderr: '%s'" % (cmd, stdout.rstrip(), stderr.rstrip()))
873
		lines = stdout.rstrip('\n').split('\n')
873
		lines = stdout.strip('\n').split('\n')
874
		if not stdout:
874
		lines = [line for line in lines if not line.startswith(';')]
875
			log.debug("Error: DNS lookup for DC at IP %s failed." % ad_server_ip)
875
		if len(lines) == 0:
876
			log.error("Error: DNS lookup for DC at IP %s failed: %s" % (ad_server_ip, stdout))
876
			try:
877
			try:
877
				msgs = remote_samdb.search(base="", scope=samba.ldb.SCOPE_BASE,
878
				msgs = remote_samdb.search(base="", scope=samba.ldb.SCOPE_BASE,
878
											attrs=["defaultNamingContext"])
879
											attrs=["defaultNamingContext"])
 Lines 888-893    Link Here 
888
					else:
889
					else:
889
						log.error("Please retry by passing the AD server name as additional command line argument.")
890
						log.error("Please retry by passing the AD server name as additional command line argument.")
890
				else:
891
				else:
892
					log.debug("Remote domain lookup in AD failed as well.")
891
					log.error("Please retry by passing the AD server name as additional command line argument.")
893
					log.error("Please retry by passing the AD server name as additional command line argument.")
892
				sys.exit(1)
894
				sys.exit(1)
893
			except ldb.LdbError:
895
			except ldb.LdbError:
 Lines 962-968    Link Here 
962
				log.info("Sucessfull determined AD DC FQDN %s for given IP %s" % (ad_server_fqdn, ad_server_ip))
964
				log.info("Sucessfull determined AD DC FQDN %s for given IP %s" % (ad_server_fqdn, ad_server_ip))
963
			except:
965
			except:
964
				msg = []
966
				msg = []
965
				msg.append("Error: Parsing of DNS SRV record failed: '%s'." % lines.rstrip())
967
				msg.append("Error: Parsing of DNS SRV record failed: '%s'." % lines[0].rstrip())
966
				msg.append("Please retry by passing the AD server name as additional command line argument.")
968
				msg.append("Please retry by passing the AD server name as additional command line argument.")
967
				log.error("\n".join(msg))
969
				log.error("\n".join(msg))
968
				sys.exit(1)
970
				sys.exit(1)

Return to bug 31731