← Back to team overview

sts-sponsors team mailing list archive

Re: [Merge] ~adam-collard/maas:vault-proxy into maas:master

 


Diff comments:

> diff --git a/src/maasserver/bootsources.py b/src/maasserver/bootsources.py
> index c58b19a..58c6cb7 100644
> --- a/src/maasserver/bootsources.py
> +++ b/src/maasserver/bootsources.py
> @@ -97,6 +97,15 @@ def get_boot_sources():
>      return [source.to_dict() for source in BootSource.objects.all()]
>  
>  
> +def _upsert_no_proxy_env(env, entry):

I'd change this to take a list of entries, so it can do the split/join work once.
Something like:

def _upsert_no_proxy_env(env, entries):
    env_entries = set(env.get("no_proxy", "").split(",")
    env_entries.update(entries)
    env["no_proxy"] = ",".join(env_entries)

> +    """Updates $no_proxy appropriately."""
> +    if no_proxy := env.get("no_proxy"):
> +        if entry not in no_proxy.split(","):
> +            env["no_proxy"] = f"{no_proxy},{entry}"
> +    else:
> +        env["no_proxy"] = entry
> +
> +
>  @transactional
>  def get_simplestreams_env():
>      """Get environment that should be used with simplestreams."""


-- 
https://code.launchpad.net/~adam-collard/maas/+git/maas/+merge/435387
Your team MAAS Committers is subscribed to branch maas:master.



References