[elbe-devel] [PATCH 20/20] rfs: use get_proxy_dict() for proxy_env variables
Torben Hohn
torben.hohn at linutronix.de
Fri Oct 12 11:28:06 CEST 2018
proxy logic has been isolated into debinstaller.get_proxy_dict()
and it also supports dictionaries for env_add.
Make use of get_proxy_dict()
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/rfs.py | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index fd889410..b9751933 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -15,6 +15,7 @@ from elbepack.efilesystem import BuildImgFs
from elbepack.templates import (write_pack_template, get_preseed,
preseed_to_text)
from elbepack.shellhelper import CommandError
+from elbepack.debinstaller import get_proxy_dict
class DebootstrapException (Exception):
@@ -104,17 +105,11 @@ class BuildEnv (object):
'DEBIAN_FRONTEND': 'noninteractive',
'DEBCONF_NONINTERACTIVE_SEEN': 'true'}
- if self.xml.prj.has("mirror/primary_proxy"):
- proxy = self.xml.prj.text("mirror/primary_proxy")
- proxy = proxy.strip().replace("LOCALMACHINE", "localhost")
+ proxies = get_proxy_dict(self.xml.prj,
+ proxy_default_to_env=False,
+ for_env=True)
- env.update({'no_proxy': '10.0.2.2,localhost,127.0.0.1',
- 'http_proxy': proxy,
- 'https_proxy': proxy})
- else:
- env.update({'no_proxy': '',
- 'http_proxy': '',
- 'https_proxy': ''})
+ env.update(proxies)
self.log.h2("debootstrap log")
--
2.11.0
More information about the elbe-devel
mailing list