[elbe-devel] [PATCH 04/13] unset proxy config if not specified in XML

Manuel Traut manut at linutronix.de
Thu Sep 28 23:59:52 CEST 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 9babbe2b..f92e09d2 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -194,6 +194,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.14.1




More information about the elbe-devel mailing list