Skip to content

Commit

Permalink
Add uuid to cba command when removing user
Browse files Browse the repository at this point in the history
  • Loading branch information
venekamp committed Jul 24, 2024
1 parent bb3f9e4 commit c885824
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SRAMsync/cba_script_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,18 @@ def remove_graced_user_from_group(
self._insert_cba_command(cmd=self.cfg["cba_del_cmd"], co=co, user=user)

def remove_user(self, user: str, state: State) -> None:
group: str = ""

for tmp in state.get_known_groups():
if state.is_user_member_of_group(dest_group_names=[tmp], user=user):
group = tmp
break

co: str = state["users"][user]["CO"]
org: str = state["groups"][group]["sram"]["org"]
co_uuid: str = self.org_co_uuids[f"{org}-{co}"]

logger.debug(f"CbaScriptGenerator: removing user: {user} for CO: {co}")

self._print(string=f"{self.cfg['cba_budget_account']} {user} {co}")
self._insert_cba_command(cmd=self.cfg["cba_del_cmd"], co_uuid=co_uuid, user=user)
super().remove_user(user, state)

0 comments on commit c885824

Please sign in to comment.