mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Prevent server and domain from being undefined or blank when we need them
Improve LDAP error reporting Don't return the str() of discovery values because it can return "None" 436130
This commit is contained in:
@@ -77,12 +77,11 @@ def main():
|
||||
ds = ipaclient.ipadiscovery.IPADiscovery()
|
||||
|
||||
ret = ds.search(domain=options.domain, server=options.server)
|
||||
srv = ""
|
||||
if ret == -10:
|
||||
print "Can't get the fully qualified name of this host"
|
||||
print "Please check that the client is properly configured"
|
||||
return ret
|
||||
if ret == -1:
|
||||
if ret == -1 or not ds.getDomainName():
|
||||
logging.debug("Domain not found")
|
||||
if options.domain:
|
||||
dom = options.domain
|
||||
@@ -94,7 +93,8 @@ def main():
|
||||
while dom == "":
|
||||
dom = raw_input("Please provide your domain name (ex: example.com): ")
|
||||
ret = ds.search(domain=dom)
|
||||
if ret == -2:
|
||||
dom = ds.getDomainName()
|
||||
if ret == -2 or not ds.getServerName():
|
||||
dnsok = False
|
||||
logging.debug("IPA Server not found")
|
||||
if options.server:
|
||||
@@ -103,11 +103,15 @@ def main():
|
||||
return ret
|
||||
else:
|
||||
print "Failed to find the IPA Server (DNS misconfigured?)"
|
||||
srv = ""
|
||||
while srv == "":
|
||||
srv = raw_input("Please provide your server name (ex: ipa.example.com): ")
|
||||
ret = ds.search(domain=dom, server=srv)
|
||||
srv = ds.getServerName()
|
||||
if ret != 0:
|
||||
print "Failed to verify that "+srv+" is an IPA Server, aborting!"
|
||||
print "Failed to verify that "+srv+" is an IPA Server."
|
||||
print "This may mean that the remote server is not up or is not reachable"
|
||||
print "due to network or firewall settings."
|
||||
return ret
|
||||
|
||||
if dnsok:
|
||||
|
||||
Reference in New Issue
Block a user