diff --git a/gitlab/build_manifest.py b/gitlab/build_manifest.py index bb384677fd..9b1e208404 100755 --- a/gitlab/build_manifest.py +++ b/gitlab/build_manifest.py @@ -69,7 +69,8 @@ def preserve_ci_vars(func): def request_raw(path: str, headers: Dict[str, str], project_url: str) -> List[Dict[str, str]]: - base_url: str = get_hostname(project_url) + # ex. base_url = "gitlab.freedesktop.org" + base_url: str = urlparse(project_url).hostname url: str = f"https://{base_url}/api/v4/{path}" print(f"GET {url}") print(f"Headers: {headers}") @@ -177,18 +178,6 @@ def test_search_user_namespace(): assert res is None -def get_hostname(url: str) -> str: - return urlparse(url).hostname - - -def test_get_hostname(): - gitlab = 'https://gitlab.com/example/a_project' - assert get_hostname(gitlab) == 'gitlab.com' - - fdo = 'https://gitlab.freedesktop.org/example/a_project' - assert get_hostname(fdo) == 'gitlab.freedesktop.org' - - def find_repository_sha(module: Tuple[str, int], branchname: str) -> Tuple[str, str]: user_login: str = os.environ["GITLAB_USER_LOGIN"] project = search_user_namespace(user_login, module[0])