mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNS Locations: dnsserver: remove config when replica is removed
Configuration of DNS server should be removed together with any other information about replica https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import six
|
||||
import time
|
||||
import datetime
|
||||
import sys
|
||||
@@ -36,6 +37,9 @@ from ipapython.dn import DN
|
||||
from ipaplatform import services
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
# the default container used by AD for user entries
|
||||
WIN_USER_CONTAINER = DN(('cn', 'Users'))
|
||||
# the default container used by IPA for user entries
|
||||
@@ -1293,6 +1297,17 @@ class ReplicationManager(object):
|
||||
elif not err:
|
||||
err = e
|
||||
|
||||
# delete DNS server configuration, if any
|
||||
try:
|
||||
api.Command.dnsserver_del(unicode(replica))
|
||||
except errors.NotFound:
|
||||
pass
|
||||
except Exception as e:
|
||||
if not force:
|
||||
raise e
|
||||
elif not err:
|
||||
err = e
|
||||
|
||||
try:
|
||||
dn = DN(('cn', 'default'), ('ou', 'profile'), self.suffix)
|
||||
ret = self.conn.get_entry(dn)
|
||||
|
||||
Reference in New Issue
Block a user