summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-04-12 09:44:50 +0200
committerMartin Kosek <mkosek@redhat.com>2012-04-16 16:11:33 +0200
commit0acdae0b4dc4809025bae6062a28fff99b105632 (patch)
tree9917249a0f62e16bf71c29f04ea481c8ffe0e42e /ipalib
parentd317c2a0d1114cb0c53c9a333538f579624e4a9b (diff)
downloadfreeipa-0acdae0b4dc4809025bae6062a28fff99b105632.tar.gz
freeipa-0acdae0b4dc4809025bae6062a28fff99b105632.tar.xz
freeipa-0acdae0b4dc4809025bae6062a28fff99b105632.zip
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
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/dns.py6
1 files changed, 6 insertions, 0 deletions
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):