mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add function to retrieve a short list of attributes to make ipa-adddelegation
easier to use.
This commit is contained in:
@@ -321,6 +321,13 @@ class IPAClient:
|
||||
|
||||
return self.transport.attrs_to_labels(attrs)
|
||||
|
||||
def get_all_attrs(self):
|
||||
"""We have a list of hardcoded attributes -> readable labels. Return
|
||||
that complete list if someone wants it.
|
||||
"""
|
||||
|
||||
return self.transport.get_all_attrs()
|
||||
|
||||
def group_members(self, groupdn, attr_list):
|
||||
"""Do a memberOf search of groupdn and return the attributes in
|
||||
attr_list (an empty list returns everything)."""
|
||||
|
||||
@@ -579,6 +579,21 @@ class RPCClient:
|
||||
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def get_all_attrs(self, opts=None):
|
||||
"""We have a list of hardcoded attributes -> readable labels. Return
|
||||
that complete list if someone wants it.
|
||||
"""
|
||||
|
||||
server = self.setup_server()
|
||||
try:
|
||||
result = server.get_all_attrs()
|
||||
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)
|
||||
|
||||
def group_members(self, groupdn, attr_list=None):
|
||||
"""Do a memberOf search of groupdn and return the attributes in
|
||||
attr_list (an empty list returns everything)."""
|
||||
|
||||
Reference in New Issue
Block a user