summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 570d66e00..ba111d46b 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -31,6 +31,12 @@ from ipalib import errors
from ipapython import dnsclient
+def json_serialize(obj):
+ if not callable(getattr(obj, '__json__', None)):
+ # raise TypeError('%r is not JSON serializable')
+ return ''
+ return obj.__json__()
+
def get_current_principal():
try:
return unicode(krbV.default_context().default_ccache().principal().name)