parsing: treat locations without scheme as belonging to 'tree://'

This commit is contained in:
Nikita Dubrovskii 2024-10-28 11:20:23 +01:00 committed by Michael Vogt
parent 077244e3b9
commit 6a59e740e4
3 changed files with 42 additions and 7 deletions

View file

@ -77,11 +77,15 @@ def parse_location_into_parts(location: str, args: Dict) -> Tuple[str, str]:
Parses the location URL to derive the corresponding root and url path.
Parameters:
- location (str): The location URL to be parsed.
- location (str): The location URL to be parsed. If the URL has no scheme,
then 'tree://' is implied
- args (Dict): A dictionary containing arguments including mounts and
path information as passed by osbuild.api.arguments()
"""
if "://" not in location:
location = f"tree://{location}"
url = urlparse(location)
scheme = url.scheme