From 04636b8ae7b759291fe0c49991b3df760d6ad4c2 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 22 Oct 2007 17:06:52 -0400 Subject: Add an LDAP attribute -> label mapping function to XML-RPC layer Move some ACI functions around in preparation for cli delegation --- ipa-server/xmlrpc-server/funcs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ipa-server/xmlrpc-server/funcs.py') diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index f62a6aba..7ce83d57 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.""" -- cgit