[elbe-devel] [PATCH 1/1] init: replace localhost with 10.0.2.2 in initvm proxy setting

Bastian Germann bage at linutronix.de
Mon Sep 23 10:36:36 CEST 2019


> when the required http proxy is set to localhost, the initvm
> must use 10.0.2.2 as the proxy.
> 
> Do not use LOCALMACHINE here, because we are using a global environment
> variable here, which would become meaningless to other programs, if
> we were using LOCALMACHINE.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/commands/init.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index ec4aa2fd8..ffa0b0e53 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -169,12 +169,14 @@ def run_command(argv):
>              (out_path, e.strerror))
>          sys.exit(30)
>  
> +    initvm_http_proxy = http_proxy.replace('http://localhost:',
> +                                           'http://10.0.2.2:')
>      d = {"elbe_version": elbe_version,
>           "defs": defs,
>           "opt": opt,
>           "xml": xml,
>           "prj": xml.node("/initvm"),
> -         "http_proxy": http_proxy,
> +         "http_proxy": initvm_http_proxy,
>           "pkgs": xml.node("/initvm/pkg-list") or [],
>           "preseed": get_initvm_preseed(xml),
>           "machine_type": machine_type,
> 



More information about the elbe-devel mailing list