delegate removal of master DNS record and replica keys to separate functions

https://fedorahosted.org/freeipa/ticket/5588

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Martin Babinsky authored and Martin Basti committed 2016-06-17 18:55:19 +02:00
1 parent d8ae2b4055
commit db882ae8d6
3 files changed
+14 -6

No files matched your search

+2 -6
View File
@@ -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")
+6
View File
@@ -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
+6
View File
@@ -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):