Commit bfbbd165 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch '10-exception-when-group_path-is-invalid' into 'main'

Resolve "Exception when group_path is invalid"

Closes #10

See merge request to-be-continuous/tools/gitlab-butler!40
parents 88feccf9 088043ff
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -212,6 +212,15 @@ def run() -> None:
    # retrieve root group
    try:
        group = butler.client.groups.get(butler.group_path)

        # check if group_path returned by API match group_path provided by user
        if butler.group_path != group.full_path:
            print(
                f"{AnsiColors.BLUE}Warning:{AnsiColors.RESET} provided group path {AnsiColors.BLUE}{butler.group_path}{AnsiColors.RESET} is not in canonical form (should be: {AnsiColors.BLUE}{group.full_path}{AnsiColors.RESET})"
            )
            # replace user provided group path with the API provided group path
            butler.group_path = group.full_path

    except GitlabGetError as ge:
        print(
            f"Src group {AnsiColors.BLUE}{butler.group_path}{AnsiColors.RESET}: get {AnsiColors.HRED}failed{AnsiColors.RESET}",