summaryrefslogtreecommitdiffstats
path: root/ipa-python/ipaclient.py
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-10-09 09:26:16 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-10-09 09:26:16 -0700
commit2b38769b50b51d28111a07be86d9fc70e5b6b8f5 (patch)
tree0eb02fb25e56a42b11f32ff83cde1f5337ae28ce /ipa-python/ipaclient.py
parentaaa992b74405f41e2f51d1fb2946c57303c3de07 (diff)
downloadfreeipa-2b38769b50b51d28111a07be86d9fc70e5b6b8f5.tar.gz
freeipa-2b38769b50b51d28111a07be86d9fc70e5b6b8f5.tar.xz
freeipa-2b38769b50b51d28111a07be86d9fc70e5b6b8f5.zip
Combine get_user/group by dn/cn into get_entry_by_cn/dn.
Also a couple double-escaping fixes I missed in the last patch.
Diffstat (limited to 'ipa-python/ipaclient.py')
-rw-r--r--ipa-python/ipaclient.py38
1 files changed, 17 insertions, 21 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py
index ae6ed31e4..3a6e1305c 100644
--- a/ipa-python/ipaclient.py
+++ b/ipa-python/ipaclient.py
@@ -26,6 +26,7 @@ if "/usr/share/ipa" not in sys.path:
from ipaserver import funcs
import ipa.rpcclient as rpcclient
+import entity
import user
import group
import ipa
@@ -53,6 +54,22 @@ class IPAClient:
if self.local:
self.transport.set_krbccache(krbccache)
+# General searches
+
+ def get_entry_by_dn(self,dn,sattrs=None):
+ """Get a specific entry by dn. If sattrs is set then only those
+ attributes will be returned, otherwise all available attributes
+ are returned."""
+ result = self.transport.get_entry_by_dn(dn,sattrs)
+ return entity.Entity(result)
+
+ def get_entry_by_cn(self,cn,sattrs=None):
+ """Get a specific entry by cn. If sattrs is set then only those
+ attributes will be returned, otherwise all available attributes
+ are returned."""
+ result = self.transport.get_entry_by_cn(cn,sattrs)
+ return entity.Entity(result)
+
# User support
def get_user_by_uid(self,uid,sattrs=None):
"""Get a specific user by uid. If sattrs is set then only those
@@ -61,13 +78,6 @@ class IPAClient:
result = self.transport.get_user_by_uid(uid,sattrs)
return user.User(result)
- def get_user_by_dn(self,dn,sattrs=None):
- """Get a specific user by dn. If sattrs is set then only those
- attributes will be returned, otherwise all available attributes
- are returned."""
- result = self.transport.get_user_by_dn(dn,sattrs)
- return user.User(result)
-
def get_user_by_principal(self,principal,sattrs=None):
"""Get a specific user by uid. If sattrs is set then only those
attributes will be returned, otherwise all available attributes
@@ -154,20 +164,6 @@ class IPAClient:
# Groups support
- def get_group_by_cn(self,cn,sattrs=None):
- """Get a specific group by cn. If sattrs is set then only those
- attributes will be returned, otherwise all available attributes
- are returned."""
- result = self.transport.get_group_by_cn(cn,sattrs)
- return group.Group(result)
-
- def get_group_by_dn(self,dn,sattrs=None):
- """Get a specific group by cn. If sattrs is set then only those
- attributes will be returned, otherwise all available attributes
- are returned."""
- result = self.transport.get_group_by_dn(dn,sattrs)
- return group.Group(result)
-
def get_groups_by_member(self,member_dn,sattrs=None):
"""Gets the groups that member_dn belongs to.
If sattrs is not None then only those