Always consider domain and server when doing DNS discovery in client.

When not on master we weren't passing in the user-supplied domain and
server. Because of changes made that require TLS on the LDAP calls
we always need the server name early in the process to retrieve the IPA
CA certificate.

ticket 1090
This commit is contained in:
Rob Crittenden
2011-03-15 09:12:35 -04:00
committed by Adam Young
parent 0b6b2342d0
commit a36bc4ee93

View File

@@ -684,10 +684,8 @@ def main():
# Create the discovery instance
ds = ipaclient.ipadiscovery.IPADiscovery()
if options.on_master:
ret = ds.search(domain=options.domain, server=options.server)
else:
ret = ds.search()
ret = ds.search(domain=options.domain, server=options.server)
if ret == -10:
print >>sys.stderr, "Can't get the fully qualified name of this host"
print >>sys.stderr, "Please check that the client is properly configured"
@@ -703,10 +701,8 @@ def main():
print "DNS discovery failed to determine your DNS domain"
cli_domain = user_input("Please provide the domain name of your IPA server (ex: example.com)", allow_empty = False)
logging.debug("will use domain: %s\n", cli_domain)
if options.on_master:
ret = ds.search(domain=cli_domain, server=options.server)
else:
ret = ds.search(domain=cli_domain)
ret = ds.search(domain=cli_domain, server=options.server)
if not cli_domain:
if ds.getDomainName():
cli_domain = ds.getDomainName()