mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make LDAPObject classes JSON serializable.
This commit is contained in:
committed by
Rob Crittenden
parent
9d9d789912
commit
5797c8167a
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user