mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Detect if DNS is already configured in IPA, or if IPA is not yet installed.
ipa-dns-manage could fail in very odd ways depending on the current configuration of the server. Handle things a bit better. ticket 210
This commit is contained in:
@@ -110,6 +110,9 @@ def main():
|
|||||||
api.bootstrap(**cfg)
|
api.bootstrap(**cfg)
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
|
||||||
|
if bindinstance.dns_container_exists(api.env.host, api.env.realm):
|
||||||
|
sys.exit("\nDNS is already configured in this IPA server.")
|
||||||
|
|
||||||
# Check we have a public IP that is associated with the hostname
|
# Check we have a public IP that is associated with the hostname
|
||||||
if options.ip_address:
|
if options.ip_address:
|
||||||
ip_address = options.ip_address
|
ip_address = options.ip_address
|
||||||
@@ -176,6 +179,8 @@ except SystemExit, e:
|
|||||||
sys.exit(e)
|
sys.exit(e)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print "Installation cancelled."
|
print "Installation cancelled."
|
||||||
|
except RuntimeError, e:
|
||||||
|
print str(e)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
message = "Unexpected error - see ipaserver-install.log for details:\n %s" % str(e)
|
message = "Unexpected error - see ipaserver-install.log for details:\n %s" % str(e)
|
||||||
print message
|
print message
|
||||||
|
@@ -74,8 +74,11 @@ def dns_container_exists(fqdn, realm):
|
|||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
try:
|
||||||
server = ldap.initialize("ldap://" + fqdn)
|
server = ldap.initialize("ldap://" + fqdn)
|
||||||
server.simple_bind_s()
|
server.simple_bind_s()
|
||||||
|
except ldap.SERVER_DOWN:
|
||||||
|
raise RuntimeError('LDAP server on %s is not responding. Is IPA installed?' % fqdn)
|
||||||
|
|
||||||
suffix = util.realm_to_suffix(realm)
|
suffix = util.realm_to_suffix(realm)
|
||||||
ret = object_exists("cn=dns,%s" % suffix)
|
ret = object_exists("cn=dns,%s" % suffix)
|
||||||
|
Reference in New Issue
Block a user