From 71a032db19fcebfeb5f258f6855987749e3a4e21 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 29 Sep 2010 14:51:35 -0400 Subject: 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 --- ipaserver/install/bindinstance.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ipaserver/install/bindinstance.py') diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index a6b49003..4e63e7e3 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -74,8 +74,11 @@ def dns_container_exists(fqdn, realm): else: return True - server = ldap.initialize("ldap://" + fqdn) - server.simple_bind_s() + try: + server = ldap.initialize("ldap://" + fqdn) + 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) ret = object_exists("cn=dns,%s" % suffix) -- cgit