build_manifest.py: remove get_hostname function

Not really needed anymore now that it just calls urlparse.
parent 9d637f66
......@@ -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])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment