Skip to content

Commit

Permalink
Add org to state file
Browse files Browse the repository at this point in the history
  • Loading branch information
venekamp committed Jul 24, 2024
1 parent ca411a1 commit bb3f9e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SRAMsync/json_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
}

Expand Down
2 changes: 1 addition & 1 deletion SRAMsync/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
1 change: 1 addition & 0 deletions SRAMsync/sync_with_sram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit bb3f9e4

Please sign in to comment.