diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-07-02 10:04:28 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-07-02 13:33:04 -0400 |
commit | 5e4c0014df46cd9a00ec8b8099533522cbbc1448 (patch) | |
tree | 0b893e62a46b50d5ad744e6e8dbc70256aed5992 /ipalib | |
parent | 3c5988d0783ec8528c3740bdbbd80fc08feece68 (diff) | |
download | freeipa-5e4c0014df46cd9a00ec8b8099533522cbbc1448.tar.gz freeipa-5e4c0014df46cd9a00ec8b8099533522cbbc1448.tar.xz freeipa-5e4c0014df46cd9a00ec8b8099533522cbbc1448.zip |
Fix bug: when deleting hosts, their services where deleted incorrectly
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/host.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index 472f8262..c1fa987b 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -28,6 +28,7 @@ import sys from ipalib import api, crud, errors, util from ipalib import Object from ipalib import Str, Flag +from ipalib.plugins.service import split_principal _container_dn = api.env.container_host _default_attributes = [ @@ -210,12 +211,15 @@ class host_del(crud.Delete): """ ldap = self.api.Backend.ldap2 dn = get_host(ldap, hostname) + hostname = hostname.lower() # Remove all service records for this host (services, truncated) = api.Command['service_find'](hostname) - for (dn, entry_attrs) in services: - principal = entry_attrs['krbprincipalname'] - api.Command['service_del'](principal) + for (dn_, entry_attrs) in services: + principal = entry_attrs['krbprincipalname'][0] + (service, hostname_, realm) = split_principal(principal) + if hostname_.lower() == hostname: + api.Command['service_del'](principal) ldap.delete_entry(dn) |