From 478186e4852601f83153f657e9ccb2a472d45d38 Mon Sep 17 00:00:00 2001 From: Jr Aquino Date: Thu, 17 Feb 2011 09:54:26 -0800 Subject: Cleanup for netgroup search https://fedorahosted.org/freeipa/ticket/963 --- ipalib/plugins/netgroup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ipalib') 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) -- cgit