From 0acdae0b4dc4809025bae6062a28fff99b105632 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Thu, 12 Apr 2012 09:44:50 +0200 Subject: Return correct record name in DNS plugin When dnsrecord-add or dnsrecord-mod commands are used on a root zone record (it has a special name "@"), a zone name is returned instead of a special name "@". This confuses DNS part of Web UI which is then not able to manipulate records in the root zone when these commands are used. This patch fixes these 2 commands to return correct value when a root zone is modified. https://fedorahosted.org/freeipa/ticket/2627 https://fedorahosted.org/freeipa/ticket/2628 --- ipalib/plugins/dns.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ipalib/plugins/dns.py') diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index b7069fb7a..88ee29ba4 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -2227,6 +2227,9 @@ class dnsrecord_add(LDAPCreate): param = self.params[attr] param.dnsrecord_add_post_callback(ldap, dn, entry_attrs, *keys, **options) + if self.obj.is_pkey_zone_record(*keys): + entry_attrs[self.obj.primary_key.name] = [_dns_zone_record] + self.obj.postprocess_record(entry_attrs, **options) return dn @@ -2321,6 +2324,9 @@ class dnsrecord_mod(LDAPUpdate): return result def post_callback(self, ldap, dn, entry_attrs, *keys, **options): + if self.obj.is_pkey_zone_record(*keys): + entry_attrs[self.obj.primary_key.name] = [_dns_zone_record] + self.obj.postprocess_record(entry_attrs, **options) def interactive_prompt_callback(self, kw): -- cgit