summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/internal.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/internal.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/internal.py')
-rw-r--r--ipalib/plugins/internal.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 096da18d8..e950796b5 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -73,16 +73,23 @@ class json_metadata(Command):
)
def execute(self, objname):
+
if objname and objname in self.api.Object:
- return dict(
+
+ meta = dict(
result=dict(
((objname, json_serialize(self.api.Object[objname])), )
)
)
- result=dict(
- (o.name, json_serialize(o)) for o in self.api.Object()
- )
- retval= dict([("metadata",result),("messages",json_serialize(self.messages))])
+ retval= dict([("metadata",meta), ("messages",dict())])
+
+ else:
+ meta=dict(
+ (o.name, json_serialize(o)) for o in self.api.Object()
+ )
+
+ retval= dict([("metadata",meta),
+ ("messages",json_serialize(self.messages))])
return retval