diff options
author | Rob Crittenden <rcritten@redhat.com> | 2007-10-22 17:06:52 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2007-10-22 17:06:52 -0400 |
commit | 04636b8ae7b759291fe0c49991b3df760d6ad4c2 (patch) | |
tree | 5ef85e2b057c2dc94c5744492ddd83f70efa3a2b /ipa-server/xmlrpc-server/funcs.py | |
parent | a47f893957a2b07b87f26429183f61d781a257fc (diff) | |
download | freeipa-04636b8ae7b759291fe0c49991b3df760d6ad4c2.tar.gz freeipa-04636b8ae7b759291fe0c49991b3df760d6ad4c2.tar.xz freeipa-04636b8ae7b759291fe0c49991b3df760d6ad4c2.zip |
Add an LDAP attribute -> label mapping function to XML-RPC layer
Move some ACI functions around in preparation for cli delegation
Diffstat (limited to 'ipa-server/xmlrpc-server/funcs.py')
-rw-r--r-- | ipa-server/xmlrpc-server/funcs.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index f62a6aba8..7ce83d576 100644 --- a/ipa-server/xmlrpc-server/funcs.py +++ b/ipa-server/xmlrpc-server/funcs.py @@ -28,6 +28,7 @@ import ipaserver.ipaldap import ipa.ipautil import xmlrpclib import copy +import attrs from ipa import ipaerror import string @@ -1051,6 +1052,16 @@ class IPAServer: raise return ret + def attrs_to_labels(self, attr_list, opts=None): + """Take a list of LDAP attributes and convert them to more friendly + labels.""" + label_list = {} + + for a in attr_list: + label_list[a] = attrs.attr_label_list.get(a,a) + + return label_list + def ldap_search_escape(match): """Escapes out nasty characters from the ldap search. See RFC 2254.""" |