Skip to content

Commit

Permalink
+ sorting to browser export
Browse files Browse the repository at this point in the history
  • Loading branch information
XargsUK committed Feb 25, 2024
1 parent c2a1e89 commit 91f9a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ __pycache__/
*.pyd
.vscode
configs/
configs/*
local_env.txt
ous/
3 changes: 3 additions & 0 deletions lambda_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ def generate_browser_plugin_config(accounts, account_ou_mapping, role_name):
global ou_colors
config_lines = []

# Sort accounts by OU Name
accounts = sorted(accounts, key=lambda account: account_ou_mapping.get(account['Id'], {'OUName': 'Unknown'})['OUName'])

for account in accounts:
account_id = account['Id']
account_name = account['Name'].replace(' ', '_')
Expand Down

0 comments on commit 91f9a70

Please sign in to comment.