summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-10-06 19:03:26 -0400
committerAdam Young <ayoung@redhat.com>2010-10-12 14:30:13 -0400
commitdcc0d76ef97529884eb37e145322d44f68bf2576 (patch)
treeba864c913f0b4bc2c93e9b8ab17ff9c5b6413e59 /ipalib/plugins/dns.py
parent1dc0a3ab3e145e0f8fdfd71a1205b546a906bd51 (diff)
downloadfreeipa-dcc0d76ef97529884eb37e145322d44f68bf2576.tar.gz
freeipa-dcc0d76ef97529884eb37e145322d44f68bf2576.tar.xz
freeipa-dcc0d76ef97529884eb37e145322d44f68bf2576.zip
dns metadata
This is a little bit of a copy and paste approach, as the code for__json__ was copied from baseldap. Long term, we want to rewrite this plugin as an extension of baseldap anyway.
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 85a0d8225..77bec45f1 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -187,6 +187,21 @@ class dns(Object):
),
)
+ default_attributes = _zone_default_attributes
+
+ json_friendly_attributes = (
+ 'default_attributes', 'label', 'name', 'takes_params' )
+
+ def __json__(self):
+ json_dict = dict(
+ (a, getattr(self, a)) for a in self.json_friendly_attributes
+ )
+ if self.primary_key:
+ json_dict['primary_key'] = self.primary_key.name
+ json_dict['methods'] = [m for m in self.methods]
+ return json_dict
+
+
api.register(dns)