diff options
author | Jan Cholasta <jcholast@redhat.com> | 2013-04-15 12:19:35 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-04-16 12:55:21 +0200 |
commit | 52a9b23ee86b04b82a366e7ea5578cb61e96e52d (patch) | |
tree | 901601e8a057213f47cbefeaf9023d5fe64b9252 | |
parent | 58cb8f450b6410c40e22f8d1f66867977d09e252 (diff) | |
download | freeipa-52a9b23ee86b04b82a366e7ea5578cb61e96e52d.tar.gz freeipa-52a9b23ee86b04b82a366e7ea5578cb61e96e52d.tar.xz freeipa-52a9b23ee86b04b82a366e7ea5578cb61e96e52d.zip |
Delete DNS records in ipa-ca on ipa-csreplica-manage del.
https://fedorahosted.org/freeipa/ticket/3547
-rwxr-xr-x | install/tools/ipa-csreplica-manage | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/install/tools/ipa-csreplica-manage b/install/tools/ipa-csreplica-manage index db368c6fa..55bf565d5 100755 --- a/install/tools/ipa-csreplica-manage +++ b/install/tools/ipa-csreplica-manage @@ -26,7 +26,7 @@ import ldap, krbV from ipapython.ipa_log_manager import * from ipapython import ipautil -from ipaserver.install import replication, installutils +from ipaserver.install import replication, installutils, bindinstance from ipaserver import ipaldap from ipapython import version from ipapython import dogtag @@ -380,6 +380,18 @@ def del_master(realm, hostname, options): except Exception, e: sys.exit("There were issues removing a connection: %s" % convert_error(e)) + # 6. And clean up the removed replica DNS entries if any. + try: + if bindinstance.dns_container_exists(options.host, api.env.basedn, + dm_password=options.dirman_passwd): + api.Backend.ldap2.connect(bind_dn=DN(('cn', 'Directory Manager')), + bind_pw=options.dirman_passwd) + bind = bindinstance.BindInstance() + bind.remove_ipa_ca_dns_records(hostname, realm.lower()) + except Exception, e: + print "Failed to cleanup %s DNS entries: %s" % (hostname, e) + print "You may need to manually remove them from the tree" + def add_link(realm, replica1, replica2, dirman_passwd, options): repl2 = get_cs_replication_manager(realm, replica2, dirman_passwd) try: |