launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32587
Re: [Merge] ~ruinedyourlife/launchpad:maven-and-cargo-proxies into launchpad:master
Diff comments:
> diff --git a/lib/lp/crafts/model/craftrecipebuildjob.py b/lib/lp/crafts/model/craftrecipebuildjob.py
> index 58aa740..296ebf5 100644
> --- a/lib/lp/crafts/model/craftrecipebuildjob.py
> +++ b/lib/lp/crafts/model/craftrecipebuildjob.py
> @@ -451,6 +470,24 @@ class CraftPublishingJob(CraftRecipeBuildJobDerived):
> :param password: Maven repository password
> :return: XML content as string
> """
> + # Get proxy settings from config
Should this be done with urlparse lib ? Something like that:
if proxy_url:
parsed = urlparse(proxy_url)
proxy_host = parsed.hostname
proxy_port = parsed.port
> + proxy_url = config.launchpad.http_proxy
> + proxy_host = None
> + proxy_port = None
> +
> + if proxy_url:
> + # Parse the proxy URL to extract host and port
> + # Example: http://localhost:8080 -> host=localhost, port=8080
> + proxy_parts = (
> + proxy_url.replace("http://", "")
> + .replace("https://", "")
> + .split(":")
> + )
> + if len(proxy_parts) >= 1:
> + proxy_host = proxy_parts[0]
> + if len(proxy_parts) >= 2:
> + proxy_port = proxy_parts[1].split("/")[0] # Remove any path
> +
> # Break it into smaller parts to avoid long lines
> header = (
> '<?xml version="1.0" encoding="UTF-8"?>\n'
--
https://code.launchpad.net/~ruinedyourlife/launchpad/+git/launchpad/+merge/486656
Your team Launchpad code reviewers is requested to review the proposed merge of ~ruinedyourlife/launchpad:maven-and-cargo-proxies into launchpad:master.
References