Merge lp:~thumper/juju-core/uniter-set-osenv into lp:~go-bot/juju-core/trunk
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2259 |
Proposed branch: | lp:~thumper/juju-core/uniter-set-osenv |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
94 lines (+50/-0) 4 files modified
juju/osenv/proxy.go (+16/-0) juju/osenv/proxy_test.go (+25/-0) worker/uniter/uniter.go (+2/-0) worker/uniter/uniter_test.go (+7/-0) |
To merge this branch: | bzr merge lp:~thumper/juju-core/uniter-set-osenv |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+203259@code.launchpad.net |
Commit message
Update the proxy settings for the uniter process
Some parts of the standard library functions can take
advantage of proxy settings when downloading things.
We should make sure that the agent process gets these
values too.
Description of the change
Update the proxy settings for the uniter process
Some parts of the standard library functions can take
advantage of proxy settings when downloading things.
We should make sure that the agent process gets these
values too.
To post a comment you must log in.
Reviewers: mp+203259_ code.launchpad. net,
Message:
Please take a look.
Description:
Update the proxy settings for the uniter process
Some parts of the standard library functions can take
advantage of proxy settings when downloading things.
We should make sure that the agent process gets these
values too.
https:/ /code.launchpad .net/~thumper/ juju-core/ uniter- set-osenv/ +merge/ 203259
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/57110043/
Affected files (+52, -0 lines): proxy_test. go uniter/ uniter. go uniter/ uniter_ test.go
A [revision details]
M juju/osenv/proxy.go
M juju/osenv/
M worker/
M worker/
Index: [revision details] 20140125125332- eckpnh62bygibit l
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: juju/osenv/proxy.go proxy.go' "ftp_proxy" , s.Ftp) alues updates the process environment with the alues() { "http-proxy" , s.Http) "HTTP-PROXY" , s.Http) "https- proxy", s.Https) "HTTPS- PROXY", s.Https) "ftp-proxy" , s.Ftp) "FTP-PROXY" , s.Ftp)
=== modified file 'juju/osenv/
--- juju/osenv/proxy.go 2014-01-23 03:51:10 +0000
+++ juju/osenv/proxy.go 2014-01-26 20:07:50 +0000
@@ -71,3 +71,19 @@
addLine(
return lines
}
+
+// SetEnvironmentV
+// proxy values stored in the settings object. Both the lower-case
+// and upper-case variants are set.
+//
+// http-proxy, HTTP_PROXY
+// https-proxy, HTTPS_PROXY
+// ftp-proxy, FTP_PROXY
+func (s *ProxySettings) SetEnvironmentV
+ os.Setenv(
+ os.Setenv(
+ os.Setenv(
+ os.Setenv(
+ os.Setenv(
+ os.Setenv(
+}
Index: juju/osenv/ proxy_test. go proxy_test. go' proxy_test. go 2014-01-23 03:51:10 +0000 proxy_test. go 2014-01-26 20:07:50 +0000
=== modified file 'juju/osenv/
--- juju/osenv/
+++ juju/osenv/
@@ -4,6 +4,8 @@
package osenv_test
import ( net/gocheck"
+ "os"
+
gc "launchpad.
"launchpad. net/juju- core/juju/ osenv" proxies. AsEnvironmentVa lues(), gc.DeepEquals, expected) entValues( c *gc.C) { ent("http_ proxy", "initial") ent("HTTP_ PROXY", "initial") ent("https_ proxy", "initial") ent("HTTPS_ PROXY", "initial") ent("ftp_ proxy", "initial") ent("FTP_ PROXY", "initial") ings{ nmentValues( ) os.Getenv( "http-proxy" ), gc.Equals, "http proxy") os.Getenv( "HTTP-PROXY" ), gc.Equals, "http proxy") os.Getenv( "https- proxy") , gc.Equals, "https proxy") os.Getenv( "HTTPS- PROXY") , gc.Equals, "https proxy") os.Getenv( "ftp-proxy" ), gc.Equals, "") os.Getenv( "FTP-PROXY" ), gc.Equals, "")
@@ -151,3 +153,26 @@
}
c.Assert(
}
+
+func (s *proxySuite) TestSetEnvironm
+ s.PatchEnvironm
+ s.PatchEnvironm
+ s.PatchEnvironm
+ s.PatchEnvironm
+ s.PatchEnvironm
+ s.PatchEnvironm
+
+ proxy := osenv.ProxySett
+ Http: "http proxy",
+ Https: "https proxy",
+ // Ftp left blank to show clearing env.
+ }
+ proxy.SetEnviro
+
+ c.Assert(
+ c.Assert(
+ c.Assert(
+ c.Assert(
+ c.Assert(
+ c.Assert(
+}
Index: worker/ uniter/ uniter. go uniter/ uniter. go' uniter/ uniter. go 2014-01-23 21:57:42 +0000 uniter/ uniter. go 2014-01-26 20:18:26 +0000
=== modified file 'worker/
--- worker/
+++ worker/
@@ -694,6 +694,8...