Add memberOf API call to the XML-RPC interface
Make find-groups use memberOf to have a prettier dispaly of members
This commit is contained in:
1 parent
402274af4b
commit
1d6e88565c
5 files changed
+72
-1
No files matched your search
@@ -316,3 +316,11 @@ class IPAClient:
|
||||
"""Convert a list of LDAP attributes into a more readable form."""
|
||||
|
||||
return self.transport.attrs_to_labels(attrs)
|
||||
|
||||
def memberOf(self, groupdn, attr_list):
|
||||
"""Do a memberOf search of groupdn and return the attributes in
|
||||
attr_list (an empty list returns everything)."""
|
||||
|
||||
return self.transport.memberOf(groupdn, attr_list)
|
||||
|
||||
|
||||
@@ -574,3 +574,20 @@ class RPCClient:
|
||||
raise xmlrpclib.Fault(value, msg)
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def memberOf(self, groupdn, attr_list=None):
|
||||
"""Do a memberOf search of groupdn and return the attributes in
|
||||
attr_list (an empty list returns everything)."""
|
||||
|
||||
if attr_list is None:
|
||||
attr_list = "__NONE__"
|
||||
|
||||
server = self.setup_server()
|
||||
try:
|
||||
result = server.memberOf(groupdn, attr_list)
|
||||
except xmlrpclib.Fault, fault:
|
||||
raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
|
||||
except socket.error, (value, msg):
|
||||
raise xmlrpclib.Fault(value, msg)
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
Reference in new issue
Block a user