summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/automember.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-10-31 16:54:21 +0000
committerPetr Viktorin <pviktori@redhat.com>2014-01-24 20:38:15 +0100
commitc2bd6f365d2b65082f72bd9eb104e79e8c507fe3 (patch)
tree31449afe21beb62edf20982c2215568997eb6c11 /ipalib/plugins/automember.py
parent5737eaf1348ba101ae227fa79fb4451a2413fc84 (diff)
downloadfreeipa-c2bd6f365d2b65082f72bd9eb104e79e8c507fe3.tar.gz
freeipa-c2bd6f365d2b65082f72bd9eb104e79e8c507fe3.tar.xz
freeipa-c2bd6f365d2b65082f72bd9eb104e79e8c507fe3.zip
Convert remaining frontend code to LDAPEntry API.
Diffstat (limited to 'ipalib/plugins/automember.py')
-rw-r--r--ipalib/plugins/automember.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/ipalib/plugins/automember.py b/ipalib/plugins/automember.py
index 71f9a8324..a12bfb525 100644
--- a/ipalib/plugins/automember.py
+++ b/ipalib/plugins/automember.py
@@ -300,7 +300,7 @@ class automember_add_condition(LDAPUpdate):
assert isinstance(dn, DN)
# Check to see if the automember rule exists
try:
- (tdn, test_attrs) = ldap.get_entry(dn, [])
+ dn = ldap.get_entry(dn, []).dn
except errors.NotFound:
raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0])
# Define container key
@@ -318,7 +318,7 @@ class automember_add_condition(LDAPUpdate):
entry_attrs[attr] = [key + condition for condition in options[attr]]
completed += len(entry_attrs[attr])
try:
- (dn, old_entry) = ldap.get_entry(dn, [attr])
+ old_entry = ldap.get_entry(dn, [attr])
for regex in old_entry.keys():
if not isinstance(entry_attrs[regex], (list, tuple)):
entry_attrs[regex] = [entry_attrs[regex]]
@@ -339,7 +339,7 @@ class automember_add_condition(LDAPUpdate):
# Make sure to returned the failed results if there is nothing to remove
if completed == 0:
- (dn, entry_attrs) = ldap.get_entry(dn, attrs_list)
+ ldap.get_entry(dn, attrs_list)
raise errors.EmptyModlist
return dn
@@ -386,7 +386,7 @@ class automember_remove_condition(LDAPUpdate):
assert isinstance(dn, DN)
# Check to see if the automember rule exists
try:
- (tdn, test_attrs) = ldap.get_entry(dn, [])
+ ldap.get_entry(dn, [])
except errors.NotFound:
raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0])
@@ -402,13 +402,13 @@ class automember_remove_condition(LDAPUpdate):
failed = {'failed': {}}
# Check to see if there are existing exclusive conditions present.
- (dn, exclude_present) = ldap.get_entry(dn, [EXCLUDE_RE])
+ dn = ldap.get_entry(dn, [EXCLUDE_RE]).dn
for attr in (INCLUDE_RE, EXCLUDE_RE):
failed['failed'][attr] = []
if attr in options and options[attr]:
entry_attrs[attr] = [key + condition for condition in options[attr]]
- (dn, entry_attrs_) = ldap.get_entry(dn, [attr])
+ entry_attrs_ = ldap.get_entry(dn, [attr])
old_entry = entry_attrs_.get(attr, [])
for regex in entry_attrs[attr]:
if regex in old_entry:
@@ -427,7 +427,7 @@ class automember_remove_condition(LDAPUpdate):
# Make sure to returned the failed results if there is nothing to remove
if completed == 0:
- (dn, entry_attrs) = ldap.get_entry(dn, attrs_list)
+ ldap.get_entry(dn, attrs_list)
raise errors.EmptyModlist
return dn
@@ -557,13 +557,13 @@ class automember_default_group_remove(LDAPUpdate):
api.env.basedn)
attr = 'automemberdefaultgroup'
- (dn, entry_attrs_) = ldap.get_entry(dn, [attr])
+ entry_attrs_ = ldap.get_entry(dn, [attr])
if attr not in entry_attrs_:
raise errors.NotFound(reason=_(u'No default (fallback) group set'))
else:
entry_attrs[attr] = []
- return dn
+ return entry_attrs_.dn
def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
assert isinstance(dn, DN)