summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJr Aquino <jr.aquino@citrix.com>2011-02-17 09:54:26 -0800
committerRob Crittenden <rcritten@redhat.com>2011-02-18 10:32:35 -0500
commit478186e4852601f83153f657e9ccb2a472d45d38 (patch)
tree49cf88d5b17b486133d0946594b61404c64df36f /ipalib
parentbc8d33307ab4f5d002c29bb92f91fcb95239904d (diff)
downloadfreeipa-478186e4852601f83153f657e9ccb2a472d45d38.tar.gz
freeipa-478186e4852601f83153f657e9ccb2a472d45d38.tar.xz
freeipa-478186e4852601f83153f657e9ccb2a472d45d38.zip
Cleanup for netgroup search https://fedorahosted.org/freeipa/ticket/963
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/netgroup.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py
index e89d8c8d..3e45fcc7 100644
--- a/ipalib/plugins/netgroup.py
+++ b/ipalib/plugins/netgroup.py
@@ -197,11 +197,13 @@ class netgroup_find(LDAPSearch):
# Do not display private mepManagedEntry netgroups by default
# If looking for private groups, we need to omit the negation search filter
+ search_kw = {}
+ search_kw['objectclass'] = ['mepManagedEntry']
if not options['private']:
- search_kw = self.args_options_2_entry(**options)
- search_kw['objectclass'] = ['mepManagedEntry']
- negation = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE)
- filter = ldap.combine_filters((negation, filter), rules='&')
+ local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE)
+ else:
+ local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_ALL)
+ filter = ldap.combine_filters((local_filter, filter), rules=ldap.MATCH_ALL)
return (filter, base_dn, scope)
api.register(netgroup_find)