From 919a614dbb5b54e553668733e94019ec34d6d129 Mon Sep 17 00:00:00 2001 From: Jijo Varghese Date: Fri, 29 Jun 2018 23:36:57 -0700 Subject: [PATCH] ldap attributes filter in user_groups() ldap search currently fetches ALL attributes which is a waste of bandwidth resources and woefully slow on large ldap groups when it only needs to parse the name_attr Signed-off-by: Jijo Varghese --- awx/sso/ldap_group_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/sso/ldap_group_types.py b/awx/sso/ldap_group_types.py index 84144e0af3..b155ab99c8 100644 --- a/awx/sso/ldap_group_types.py +++ b/awx/sso/ldap_group_types.py @@ -42,6 +42,7 @@ class PosixUIDGroupType(LDAPGroupType): ) search = group_search.search_with_additional_term_string(filterstr) + search.attrlist = [self.name_attr] groups = search.execute(ldap_user.connection) except (KeyError, IndexError): pass @@ -72,4 +73,3 @@ class PosixUIDGroupType(LDAPGroupType): is_member = False return is_member -