Merge lp:~thumper/juju-core/proxy-values-exported-in-cloudinit 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: | 2261 |
Proposed branch: | lp:~thumper/juju-core/proxy-values-exported-in-cloudinit |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
36 lines (+9/-3) 2 files modified
environs/cloudinit/cloudinit.go (+2/-0) environs/cloudinit/cloudinit_test.go (+7/-3) |
To merge this branch: | bzr merge lp:~thumper/juju-core/proxy-values-exported-in-cloudinit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+203269@code.launchpad.net |
Commit message
Export the proxy settings in cloud-init
The tools are downloaded using wget, and wget
supports proxies. So best pass the proxy information
to the environment so wget can use it.
Description of the change
Export the proxy settings in cloud-init
The tools are downloaded using wget, and wget
supports proxies. So best pass the proxy informatino
to the environment so wget can use it.
To post a comment you must log in.
Reviewers: mp+203269_ code.launchpad. net,
Message:
Please take a look.
Description:
Export the proxy settings in cloud-init
The tools are downloaded using wget, and wget
supports proxies. So best pass the proxy informatino
to the environment so wget can use it.
https:/ /code.launchpad .net/~thumper/ juju-core/ proxy-values- exported- in-cloudinit/ +merge/ 203269
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/57130043/
Affected files (+11, -3 lines): cloudinit/ cloudinit. go cloudinit/ cloudinit_ test.go
A [revision details]
M environs/
M environs/
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: environs/ cloudinit/ cloudinit. go cloudinit/ cloudinit. go' cloudinit/ cloudinit. go 2014-01-24 01:05:52 +0000 cloudinit/ cloudinit. go 2014-01-26 23:28:43 +0000 .profile ] || grep -q '.juju-proxy' .profile) || ` + .juju-proxy" \n' >> /home/ubuntu/ .profile` ) ings{}) { gs.AsScriptEnvi ronment( ) strings. Split(exportedP roxyEnv, "\n")...) .juju-proxy .juju-proxy) `,
=== modified file 'environs/
--- environs/
+++ environs/
@@ -268,6 +268,8 @@
`([ ! -e /home/ubuntu/
/home/ubuntu/
`printf '\n# Added by juju\n[ -f "$HOME/.juju-proxy" ]
&& . "$HOME/
if (cfg.ProxySettings != osenv.ProxySett
+ exportedProxyEnv := cfg.ProxySettin
+ c.AddScripts(
c.AddScripts(
fmt.Sprintf(
`[ -e /home/ubuntu ] && (printf '%%s\n' %s > /home/ubuntu/
&& chown ubuntu:ubuntu /home/ubuntu/
Index: environs/ cloudinit/ cloudinit_ test.go cloudinit/ cloudinit_ test.go' cloudinit/ cloudinit_ test.go 2014-01-23 22:10:46 +0000 cloudinit/ cloudinit_ test.go 2014-01-26 23:28:43 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -848,12 +848,16 @@
cmds := cloudcfg.RunCmds() .profile ] || grep -q '.juju-proxy' .profile) || printf '\n# Added by juju\n[ .juju-proxy" \n' >> .profile` user@10. 0.0.1 user@10. 0.0.1' > /home/ubuntu/ .juju-proxy && .juju-proxy) ` user@10. 0.0.1`, user@10. 0.0.1`, user@10. 0.0.1 user@10. 0.0.1' > /home/ubuntu/ .juju-proxy && .juju-proxy) `, cmds[i+ 1:i+4], jc.DeepEquals, expected)
first := `([ ! -e /home/ubuntu/
/home/ubuntu/
-f "$HOME/.juju-proxy" ] && . "$HOME/
/home/ubuntu/
- second := `[ -e /home/ubuntu ] && (printf '%s\n' 'export
http_proxy=http://
-export HTTP_PROXY=http://
chown ubuntu:ubuntu /home/ubuntu/
+ expected := []interface{}{
+ `export http_proxy=http://
+ `export HTTP_PROXY=http://
+ `[ -e /home/ubuntu ] && (printf '%s\n' 'export
http_proxy=http://
+export HTTP_PROXY=http://
chown ubuntu:ubuntu /home/ubuntu/
+ }
found := false
for i, cmd := range cmds {
if cmd == first {
- c.Assert(cmds[i+1], gc.Equals, second)
+ c.Assert(
found = true
break
}