summaryrefslogtreecommitdiffstats
path: root/ipa-python
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-01-04 16:39:41 -0500
committerRob Crittenden <rcritten@redhat.com>2008-01-04 16:39:41 -0500
commit1c4e4b3e141996ad89d999257b3bfe10b1d150df (patch)
treee11cc14f2cf30018734bb62333ccaed4874feada /ipa-python
parentdd28d4e6f61e62839aed78ee7076578c1b1f8fa8 (diff)
downloadfreeipa-1c4e4b3e141996ad89d999257b3bfe10b1d150df.tar.gz
freeipa-1c4e4b3e141996ad89d999257b3bfe10b1d150df.tar.xz
freeipa-1c4e4b3e141996ad89d999257b3bfe10b1d150df.zip
Add function to retrieve a short list of attributes to make ipa-adddelegation
easier to use.
Diffstat (limited to 'ipa-python')
-rw-r--r--ipa-python/ipaclient.py7
-rw-r--r--ipa-python/rpcclient.py15
2 files changed, 22 insertions, 0 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py
index bd1fb235a..c5377f3af 100644
--- a/ipa-python/ipaclient.py
+++ b/ipa-python/ipaclient.py
@@ -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)."""
diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py
index c993ac991..32249fd3c 100644
--- a/ipa-python/rpcclient.py
+++ b/ipa-python/rpcclient.py
@@ -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)."""