From bb3f9e4905e2020cfc95c87b67f5f8816aac767f Mon Sep 17 00:00:00 2001 From: Gerben Venekamp Date: Wed, 24 Jul 2024 11:08:35 +0200 Subject: [PATCH] Add org to state file --- SRAMsync/json_file.py | 4 ++-- SRAMsync/state.py | 2 +- SRAMsync/sync_with_sram.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SRAMsync/json_file.py b/SRAMsync/json_file.py index f94de56..3db3b44 100644 --- a/SRAMsync/json_file.py +++ b/SRAMsync/json_file.py @@ -124,14 +124,14 @@ def add_user(self, user: str, co: str) -> None: self._new_state["users"][user] = cast(StateUser, {"CO": co}) def add_groups( - self, dest_group_names: list[str], co: str, sram_group: str, group_attributes: list[str] + self, dest_group_names: list[str], co: str, org: str, sram_group: str, group_attributes: list[str] ) -> None: for dest_group_name in dest_group_names: if dest_group_name not in self._new_state["groups"]: self._new_state["groups"][dest_group_name] = { "members": [], "attributes": group_attributes, - "sram": {"CO": co, "sram-group": sram_group, "org": ""}, + "sram": {"CO": co, "sram-group": sram_group, "org": org}, "graced_users": {}, } diff --git a/SRAMsync/state.py b/SRAMsync/state.py index 67b105f..feea29c 100644 --- a/SRAMsync/state.py +++ b/SRAMsync/state.py @@ -73,7 +73,7 @@ def add_user(self, user: str, co: str) -> None: @abstractmethod def add_groups( - self, dest_group_names: list[str], co: str, sram_group: str, group_attributes: list[str] + self, dest_group_names: list[str], co: str, org: str, sram_group: str, group_attributes: list[str] ) -> None: """Add a new group.""" diff --git a/SRAMsync/sync_with_sram.py b/SRAMsync/sync_with_sram.py index 2c65c06..428e3fc 100644 --- a/SRAMsync/sync_with_sram.py +++ b/SRAMsync/sync_with_sram.py @@ -468,6 +468,7 @@ def process_group_data(cfg: Config, fq_co: str, org: str, co: str) -> None: cfg.state.add_groups( dest_group_names=dest_group_names, co=co, + org=org, sram_group=sram_group, group_attributes=group_attributes, )