Skip to content

Commit

Permalink
Use set instead of list to avoid dups
Browse files Browse the repository at this point in the history
  • Loading branch information
upadhyeammit committed Sep 22, 2023
1 parent 4a5e465 commit 988ee32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ros/lib/rbac_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def set_host_groups(rbac_response):
return

role_list = rbac_response['data']
host_groups = []
host_groups = set()
able_to_access_all_systems = False
for role in role_list:
if 'permission' not in role:
Expand Down Expand Up @@ -201,7 +201,7 @@ def set_host_groups(rbac_response):
continue
# Finally, we have the right key: add them to our list
# The host_groups may have duplicate group_ids
host_groups.extend(value)
host_groups.update(value)

# If we found any host groups at the end of that, store them
if host_groups:
Expand Down

0 comments on commit 988ee32

Please sign in to comment.