mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
server.py: Removes dns-server configuration from ldap
After invocation of the ipa server-del <hostname> command there was still record in ldap if DNS was installed on the <hostname> server. Fixes: https://pagure.io/freeipa/issue/6572 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
dfc271fdf4
commit
063211d665
@ -692,6 +692,12 @@ class server_del(LDAPDelete):
|
|||||||
message=_("You may need to manually remove them from the "
|
message=_("You may need to manually remove them from the "
|
||||||
"tree")))
|
"tree")))
|
||||||
|
|
||||||
|
def _cleanup_server_dns_config(self, hostname):
|
||||||
|
try:
|
||||||
|
self.api.Command.dnsserver_del(hostname)
|
||||||
|
except errors.NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
def pre_callback(self, ldap, dn, *keys, **options):
|
def pre_callback(self, ldap, dn, *keys, **options):
|
||||||
pkey = self.obj.get_primary_key_from_dn(dn)
|
pkey = self.obj.get_primary_key_from_dn(dn)
|
||||||
|
|
||||||
@ -731,6 +737,9 @@ class server_del(LDAPDelete):
|
|||||||
# try to clean up the leftover DNS entries
|
# try to clean up the leftover DNS entries
|
||||||
self._cleanup_server_dns_records(pkey)
|
self._cleanup_server_dns_records(pkey)
|
||||||
|
|
||||||
|
# try to clean up the DNS config from ldap
|
||||||
|
self._cleanup_server_dns_config(pkey)
|
||||||
|
|
||||||
return dn
|
return dn
|
||||||
|
|
||||||
def exc_callback(self, keys, options, exc, call_func, *call_args,
|
def exc_callback(self, keys, options, exc, call_func, *call_args,
|
||||||
|
Loading…
Reference in New Issue
Block a user