summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-08-10 16:40:00 -0400
committerRob Crittenden <rcritten@redhat.com>2010-08-12 09:06:22 -0400
commitf15758dbea6be0894cdc2fcc19ec9d2428c797f1 (patch)
tree7b414f943c41957f1f412dbdc4150f9c45b884b3 /ipalib/plugins/baseldap.py
parent58fd1199f644a07b189087b09fdacbda74b11f27 (diff)
downloadfreeipa-f15758dbea6be0894cdc2fcc19ec9d2428c797f1.tar.gz
freeipa-f15758dbea6be0894cdc2fcc19ec9d2428c797f1.tar.xz
freeipa-f15758dbea6be0894cdc2fcc19ec9d2428c797f1.zip
Improve serialization to JSON.
- Make it recursive. - Make Param classes serializable. - Take python native data types into account.
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index c42039a5d..43fafe32a 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -137,7 +137,8 @@ class LDAPObject(Object):
json_dict = dict(
(a, getattr(self, a)) for a in self.json_friendly_attributes
)
- json_dict['primary_key'] = self.primary_key.name
+ if self.primary_key:
+ json_dict['primary_key'] = self.primary_key.name
json_dict['methods'] = [m for m in self.methods]
return json_dict