diff options
author | Jan Cholasta <jcholast@redhat.com> | 2013-04-15 12:19:35 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-04-15 21:12:41 +0200 |
commit | fe00788bb439d461e1429ffbd94e42d615e2ddf9 (patch) | |
tree | 17f7de67fa17bc44328d879e14e14fe3c661d786 /install/tools/ipa-csreplica-manage | |
parent | f684c6d6f8f8cde5689a92cf2b06914c3e3da34c (diff) | |
download | freeipa-fe00788bb439d461e1429ffbd94e42d615e2ddf9.tar.gz freeipa-fe00788bb439d461e1429ffbd94e42d615e2ddf9.tar.xz freeipa-fe00788bb439d461e1429ffbd94e42d615e2ddf9.zip |
Delete DNS records in ipa-ca on ipa-csreplica-manage del.
https://fedorahosted.org/freeipa/ticket/3547
Diffstat (limited to 'install/tools/ipa-csreplica-manage')
-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 b9fa05f94..d70f24e26 100755 --- a/install/tools/ipa-csreplica-manage +++ b/install/tools/ipa-csreplica-manage @@ -25,7 +25,7 @@ import os import krbV from ipapython.ipa_log_manager import * -from ipaserver.install import replication, installutils +from ipaserver.install import replication, installutils, bindinstance from ipalib import api, errors, util from ipapython import ipautil, ipaldap, version, dogtag from ipapython.dn import DN @@ -271,6 +271,18 @@ def del_master(realm, hostname, options): except Exception, e: sys.exit("There were issues removing a connection: %s" % 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): try: repl2 = replication.get_cs_replication_manager(realm, replica2, |