github-org-manager 0.5.5__tar.gz → 0.5.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: github-org-manager
3
- Version: 0.5.5
3
+ Version: 0.5.6
4
4
  Summary: Manage a GitHub Organization, its teams, repository permissions, and more
5
5
  Home-page: https://github.com/OpenRailAssociation/github-org-manager
6
6
  License: Apache-2.0
@@ -708,7 +708,25 @@ class GHorg: # pylint: disable=too-many-instance-attributes, too-many-lines
708
708
  continue
709
709
 
710
710
  # Convert team name to Team object
711
- team = self.org.get_team_by_slug(self._sluggify_teamname(team_name))
711
+ try:
712
+ team = self.org.get_team_by_slug(self._sluggify_teamname(team_name))
713
+ # Team not found, probably because a new team should be created, but it's a dry-run
714
+ except UnknownObjectException:
715
+ logging.debug(
716
+ "Team %s not found, probably because it should be created but it's a dry-run",
717
+ team_name,
718
+ )
719
+ # Initialise a new Team() object with the name, manually
720
+ team = Team(
721
+ requester=None, # type: ignore
722
+ headers={}, # No headers required
723
+ attributes={
724
+ "id": 0,
725
+ "name": team_name,
726
+ "slug": self._sluggify_teamname(team_name),
727
+ },
728
+ completed=True, # Mark as fully initialized
729
+ )
712
730
 
713
731
  # Get configured repo permissions
714
732
  for repo, perm in team_attrs.get("repos", {}).items():
@@ -4,7 +4,7 @@
4
4
 
5
5
  [tool.poetry]
6
6
  name = "github-org-manager"
7
- version = "0.5.5"
7
+ version = "0.5.6"
8
8
  description = "Manage a GitHub Organization, its teams, repository permissions, and more"
9
9
  authors = ["Max Mehl <max.mehl@deutschebahn.com>"]
10
10
  readme = "README.md"