diff options
author | Martin Basti <mbasti@redhat.com> | 2016-05-13 18:39:47 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-03 15:58:21 +0200 |
commit | fd2bd60383a739185a0a67fd0fb43338bab17e1d (patch) | |
tree | 3192c9045c2fd62390f2b9f6b1a914e4995992a7 /ipaserver/plugins/location.py | |
parent | 79544aa51acc6f48117391b1e0ec70e9f4d7d0bb (diff) | |
download | freeipa-fd2bd60383a739185a0a67fd0fb43338bab17e1d.tar.gz freeipa-fd2bd60383a739185a0a67fd0fb43338bab17e1d.tar.xz freeipa-fd2bd60383a739185a0a67fd0fb43338bab17e1d.zip |
DNS Locations: when removing location remove it from servers first
Locations should be removed from server by using server-mod during
location-del (future patches will handle DNS records in server-mod)
Referint plugin is configured to remove references of deleted locations.
https://fedorahosted.org/freeipa/ticket/2008
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins/location.py')
-rw-r--r-- | ipaserver/plugins/location.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ipaserver/plugins/location.py b/ipaserver/plugins/location.py index 1edda8e25..32306648c 100644 --- a/ipaserver/plugins/location.py +++ b/ipaserver/plugins/location.py @@ -137,6 +137,14 @@ class location_del(LDAPDelete): msg_summary = _('Deleted IPA location "%(value)s"') + def pre_callback(self, ldap, dn, *keys, **options): + assert isinstance(dn, DN) + servers = self.api.Command.server_find( + in_location=keys[-1])['result'] + for server in servers: + self.api.Command.server_mod(server['cn'][0], location=None) + return dn + @register() class location_mod(LDAPUpdate): |