summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinstall/tools/ipa-replica-manage8
-rw-r--r--ipaserver/install/bindinstance.py6
-rw-r--r--ipaserver/install/dnskeysyncinstance.py6
3 files changed, 14 insertions, 6 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 5a546e33c..186eb1069 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -896,12 +896,8 @@ def cleanup_server_dns_entries(realm, hostname, suffix, options):
try:
if bindinstance.dns_container_exists(options.host, suffix,
dm_password=options.dirman_passwd):
- bind = bindinstance.BindInstance()
- bind.remove_master_dns_records(hostname, realm, realm.lower())
- bind.remove_server_ns_records(hostname)
-
- keysyncd = dnskeysyncinstance.DNSKeySyncInstance()
- keysyncd.remove_replica_public_keys(hostname)
+ bindinstance.remove_master_dns_records(hostname, realm)
+ dnskeysyncinstance.remove_replica_public_keys(hostname)
except Exception as e:
print("Failed to cleanup %s DNS entries: %s" % (hostname, e))
print("You may need to manually remove them from the tree")
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 188f3dc0e..08c32f483 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -538,6 +538,12 @@ def check_forwarders(dns_forwarders, logger):
return forwarders_dnssec_valid
+def remove_master_dns_records(hostname, realm):
+ bind = BindInstance()
+ bind.remove_master_dns_records(hostname, realm, realm.lower())
+ bind.remove_server_ns_records(hostname)
+
+
class DnsBackup(object):
def __init__(self, service):
self.service = service
diff --git a/ipaserver/install/dnskeysyncinstance.py b/ipaserver/install/dnskeysyncinstance.py
index 4888d83f8..fadaf216e 100644
--- a/ipaserver/install/dnskeysyncinstance.py
+++ b/ipaserver/install/dnskeysyncinstance.py
@@ -56,6 +56,12 @@ def dnssec_container_exists(fqdn, suffix, dm_password=None, ldapi=False,
return ret
+
+def remove_replica_public_keys(hostname):
+ keysyncd = DNSKeySyncInstance()
+ keysyncd.remove_replica_public_keys(hostname)
+
+
class DNSKeySyncInstance(service.Service):
def __init__(self, fstore=None, dm_password=None, logger=root_logger,
ldapi=False, start_tls=False):