Skip to content
Snippets Groups Projects
Verified Commit 1e651977 authored by ynerant's avatar ynerant
Browse files

[ldap_lookup] Fix role search


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent ed050434
No related branches found
No related tags found
1 merge request!234[ldap_lookup] Fix role search
......@@ -200,7 +200,7 @@ class LookupModule(LookupBase):
return int(result['description'][0])
elif terms[0] == 'role':
role = terms[1]
query_id = self.base.search(f"ou=hosts,{self.base_dn}", ldap.SCOPE_ONELEVEL, f"description={role}")
query_id = self.base.search(f"ou=hosts,{self.base_dn}", ldap.SCOPE_ONELEVEL, f"description=role:{role}")
result = self.base.result(query_id)
result = [cn.decode('utf-8') for res in result[1] for cn in res[1]['cn']]
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment