dns: check if container exists using ldapi

Previously an adhoc connection was established for checking if
dns(sec) container exists. A simple or external bind was used.
Instead, always connect with ldapi through api.Backend.ldap2.

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Tomas Krizek
2016-11-11 12:45:11 +01:00
committed by Martin Babinsky
parent 28bc54f91d
commit f183f70e01
7 changed files with 15 additions and 58 deletions

View File

@@ -903,8 +903,7 @@ def ensure_last_services(conn, hostname, masters, options):
def cleanup_server_dns_entries(realm, hostname, suffix, options):
try:
if bindinstance.dns_container_exists(options.host, suffix,
dm_password=options.dirman_passwd):
if bindinstance.dns_container_exists(suffix):
bindinstance.remove_master_dns_records(hostname, realm)
dnskeysyncinstance.remove_replica_public_keys(hostname)
except Exception as e: