mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
build_manifest.py: remove get_hostname function
Not really needed anymore now that it just calls urlparse.
This commit is contained in:
parent
9d637f6694
commit
fa20357221
1 changed files with 2 additions and 13 deletions
|
@ -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]]:
|
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}"
|
url: str = f"https://{base_url}/api/v4/{path}"
|
||||||
print(f"GET {url}")
|
print(f"GET {url}")
|
||||||
print(f"Headers: {headers}")
|
print(f"Headers: {headers}")
|
||||||
|
@ -177,18 +178,6 @@ def test_search_user_namespace():
|
||||||
assert res is None
|
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]:
|
def find_repository_sha(module: Tuple[str, int], branchname: str) -> Tuple[str, str]:
|
||||||
user_login: str = os.environ["GITLAB_USER_LOGIN"]
|
user_login: str = os.environ["GITLAB_USER_LOGIN"]
|
||||||
project = search_user_namespace(user_login, module[0])
|
project = search_user_namespace(user_login, module[0])
|
||||||
|
|
Loading…
Reference in a new issue