[elbe-devel] [PATCH 06/13] unset proxy config if not specified in XML
Manuel Traut
manut at linutronix.de
Thu Nov 30 15:15:08 CET 2017
os.environ is persistent for multiple requests to elbe-daemon.
So the proxy configuration of a recent build is still active
for a new build that didn't specify any proxy. This change
sets the proxy env vars to an empty string if no proxy was
specified
Signed-off-by: Manuel Traut <manut at linutronix.de>
---
elbepack/elbexml.py | 4 ++++
elbepack/rfs.py | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index b280158a..e257856a 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -221,6 +221,10 @@ class ElbeXML(object):
proxy = self.prj.text ("mirror/primary_proxy").strip().replace("LOCALMACHINE", "10.0.2.2")
os.environ ["http_proxy"] = proxy
os.environ ["https_proxy"] = proxy
+ else:
+ os.environ ["http_proxy"] = ""
+ os.environ ["https_proxy"] = ""
+ os.environ["no_proxy"] = ""
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
authhandler = urllib2.HTTPBasicAuthHandler(passman)
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 2fa8f1a4..1a72dc81 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -99,6 +99,10 @@ class BuildEnv ():
proxy = self.xml.prj.text("mirror/primary_proxy").strip().replace("LOCALMACHINE", "localhost")
os.environ["http_proxy"] = proxy
os.environ["https_proxy"] = proxy
+ else:
+ os.environ["no_proxy"] = ""
+ os.environ["http_proxy"] = ""
+ os.environ["https_proxy"] = ""
os.environ["LANG"] = "C"
os.environ["LANGUAGE"] = "C"
--
2.15.1
More information about the elbe-devel
mailing list