Merge lp:~thumper/juju-core/machine-agent-environment into lp:~go-bot/juju-core/trunk
- machine-agent-environment
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1574 |
Proposed branch: | lp:~thumper/juju-core/machine-agent-environment |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
583 lines (+142/-75) 19 files modified
cmd/juju/cmd_test.go (+6/-5) cmd/juju/deploy.go (+2/-1) cmd/juju/environmentcommand.go (+2/-1) cmd/juju/environmentcommand_test.go (+4/-2) cmd/juju/main_test.go (+10/-7) cmd/jujud/machine.go (+2/-1) cmd/jujud/upgradevalidation.go (+2/-1) environs/azure/customdata_test.go (+0/-1) environs/cloudinit.go (+5/-1) environs/cloudinit/cloudinit.go (+4/-6) environs/cloudinit/cloudinit_test.go (+24/-23) environs/cloudinit_test.go (+11/-10) environs/local/environ.go (+11/-7) environs/local/storage/worker.go (+5/-4) juju/osenv/package_test.go (+14/-0) juju/osenv/vars.go (+16/-0) juju/osenv/vars_test.go (+20/-0) upstart/service.go (+2/-4) worker/deployer/simple.go (+2/-1) |
To merge this branch: | bzr merge lp:~thumper/juju-core/machine-agent-environment |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email:
|
Commit message
Use a map to store machine environment in config.
The MachineConfig now uses a map to store the environment
for the machine agent.
Description of the change
Use a map to store machine environment in config.
The MachineConfig now uses a map to store the environment
for the machine agent.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ian Booth (wallyworld) wrote : | # |
LGTM with the cloudinit/cloudinit fix
https:/
File environs/
https:/
environs/
= cfg.Type()
JUJU_PROVIDER_TYPE should be a const somewhere since it's used in a few
places
https:/
File environs/
https:/
environs/
Shouldn't we look in the map to ensure the provider type is set?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
https:/
File environs/
https:/
environs/
= cfg.Type()
On 2013/07/31 03:32:27, wallyworld wrote:
> JUJU_PROVIDER_TYPE should be a const somewhere since it's used in a
few places
Yes, I have been thinking about this for a while. Might as well do it
now.
https:/
File environs/
https:/
environs/
On 2013/07/31 03:32:27, wallyworld wrote:
> Shouldn't we look in the map to ensure the provider type is set?
It doesn't make it invalid like the others. So, in this case, no I
don't think so.
I felt a little uneasy making the change before that put it in there.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
Please take a look.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
On 2013/07/31 05:14:16, thumper wrote:
> Please take a look.
I started updating some of the call sites to use the new osenv
constants, but realised there were LOTS, so stopped.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
Please take a look.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeroen T. Vermeulen (jtv) wrote : | # |
LGTM, except you have conflicts. Silly ones, from the looks of it:
mostly imports, but also a case where a function gained or lost an error
return.
I was expecting to see changes to more providers' tests. Don't those
need to set the provider type in various places as well?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Penhey (thumper) wrote : | # |
On 2013/07/31 06:26:34, jtv.canonical wrote:
> LGTM, except you have conflicts. Silly ones, from the looks of it:
mostly
> imports, but also a case where a function gained or lost an error
return.
> I was expecting to see changes to more providers' tests. Don't those
need to
> set the provider type in various places as well?
It is handled by the generic environs function FinishMachineCo
Preview Diff
1 | === modified file 'cmd/juju/cmd_test.go' | |||
2 | --- cmd/juju/cmd_test.go 2013-07-11 03:25:06 +0000 | |||
3 | +++ cmd/juju/cmd_test.go 2013-07-31 21:52:25 +0000 | |||
4 | @@ -10,6 +10,7 @@ | |||
5 | 10 | . "launchpad.net/gocheck" | 10 | . "launchpad.net/gocheck" |
6 | 11 | "launchpad.net/juju-core/cmd" | 11 | "launchpad.net/juju-core/cmd" |
7 | 12 | "launchpad.net/juju-core/environs/dummy" | 12 | "launchpad.net/juju-core/environs/dummy" |
8 | 13 | "launchpad.net/juju-core/juju/osenv" | ||
9 | 13 | "launchpad.net/juju-core/juju/testing" | 14 | "launchpad.net/juju-core/juju/testing" |
10 | 14 | coretesting "launchpad.net/juju-core/testing" | 15 | coretesting "launchpad.net/juju-core/testing" |
11 | 15 | "launchpad.net/juju-core/testing/checkers" | 16 | "launchpad.net/juju-core/testing/checkers" |
12 | @@ -106,10 +107,10 @@ | |||
13 | 106 | 107 | ||
14 | 107 | // JUJU_ENV is the final place the environment can be overriden | 108 | // JUJU_ENV is the final place the environment can be overriden |
15 | 108 | com, args = cmdFunc() | 109 | com, args = cmdFunc() |
18 | 109 | oldenv := os.Getenv("JUJU_ENV") | 110 | oldenv := os.Getenv(osenv.JujuEnv) |
19 | 110 | os.Setenv("JUJU_ENV", "walthamstow") | 111 | os.Setenv(osenv.JujuEnv, "walthamstow") |
20 | 111 | testInit(c, com, args, "") | 112 | testInit(c, com, args, "") |
22 | 112 | os.Setenv("JUJU_ENV", oldenv) | 113 | os.Setenv(osenv.JujuEnv, oldenv) |
23 | 113 | assertConnName(c, com, "walthamstow") | 114 | assertConnName(c, com, "walthamstow") |
24 | 114 | 115 | ||
25 | 115 | com, args = cmdFunc() | 116 | com, args = cmdFunc() |
26 | @@ -196,8 +197,8 @@ | |||
27 | 196 | } | 197 | } |
28 | 197 | 198 | ||
29 | 198 | func (*CmdSuite) TestDeployCommandInit(c *C) { | 199 | func (*CmdSuite) TestDeployCommandInit(c *C) { |
32 | 199 | defer os.Setenv("JUJU_REPOSITORY", os.Getenv("JUJU_REPOSITORY")) | 200 | defer os.Setenv(osenv.JujuRepository, os.Getenv(osenv.JujuRepository)) |
33 | 200 | os.Setenv("JUJU_REPOSITORY", "/path/to/repo") | 201 | os.Setenv(osenv.JujuRepository, "/path/to/repo") |
34 | 201 | 202 | ||
35 | 202 | for _, t := range deployTests { | 203 | for _, t := range deployTests { |
36 | 203 | initExpectations(t.com) | 204 | initExpectations(t.com) |
37 | 204 | 205 | ||
38 | === modified file 'cmd/juju/deploy.go' | |||
39 | --- cmd/juju/deploy.go 2013-07-30 14:00:53 +0000 | |||
40 | +++ cmd/juju/deploy.go 2013-07-31 21:52:25 +0000 | |||
41 | @@ -14,6 +14,7 @@ | |||
42 | 14 | "launchpad.net/juju-core/cmd" | 14 | "launchpad.net/juju-core/cmd" |
43 | 15 | "launchpad.net/juju-core/constraints" | 15 | "launchpad.net/juju-core/constraints" |
44 | 16 | "launchpad.net/juju-core/juju" | 16 | "launchpad.net/juju-core/juju" |
45 | 17 | "launchpad.net/juju-core/juju/osenv" | ||
46 | 17 | "launchpad.net/juju-core/names" | 18 | "launchpad.net/juju-core/names" |
47 | 18 | ) | 19 | ) |
48 | 19 | 20 | ||
49 | @@ -72,7 +73,7 @@ | |||
50 | 72 | f.BoolVar(&c.BumpRevision, "upgrade", false, "") | 73 | f.BoolVar(&c.BumpRevision, "upgrade", false, "") |
51 | 73 | f.Var(&c.Config, "config", "path to yaml-formatted service config") | 74 | f.Var(&c.Config, "config", "path to yaml-formatted service config") |
52 | 74 | f.Var(constraints.ConstraintsValue{&c.Constraints}, "constraints", "set service constraints") | 75 | f.Var(constraints.ConstraintsValue{&c.Constraints}, "constraints", "set service constraints") |
54 | 75 | f.StringVar(&c.RepoPath, "repository", os.Getenv("JUJU_REPOSITORY"), "local charm repository") | 76 | f.StringVar(&c.RepoPath, "repository", os.Getenv(osenv.JujuRepository), "local charm repository") |
55 | 76 | } | 77 | } |
56 | 77 | 78 | ||
57 | 78 | func (c *DeployCommand) Init(args []string) error { | 79 | func (c *DeployCommand) Init(args []string) error { |
58 | 79 | 80 | ||
59 | === modified file 'cmd/juju/environmentcommand.go' | |||
60 | --- cmd/juju/environmentcommand.go 2013-05-10 20:55:57 +0000 | |||
61 | +++ cmd/juju/environmentcommand.go 2013-07-31 21:52:25 +0000 | |||
62 | @@ -13,6 +13,7 @@ | |||
63 | 13 | "launchpad.net/gnuflag" | 13 | "launchpad.net/gnuflag" |
64 | 14 | "launchpad.net/juju-core/cmd" | 14 | "launchpad.net/juju-core/cmd" |
65 | 15 | "launchpad.net/juju-core/environs/config" | 15 | "launchpad.net/juju-core/environs/config" |
66 | 16 | "launchpad.net/juju-core/juju/osenv" | ||
67 | 16 | ) | 17 | ) |
68 | 17 | 18 | ||
69 | 18 | const CurrentEnvironmentFilename = "current-environment" | 19 | const CurrentEnvironmentFilename = "current-environment" |
70 | @@ -55,7 +56,7 @@ | |||
71 | 55 | // JUJU_ENV environment variable. If that is set, it gets used. If it isn't | 56 | // JUJU_ENV environment variable. If that is set, it gets used. If it isn't |
72 | 56 | // set, look in the $JUJU_HOME/current-environment file. | 57 | // set, look in the $JUJU_HOME/current-environment file. |
73 | 57 | func getDefaultEnvironment() string { | 58 | func getDefaultEnvironment() string { |
75 | 58 | defaultEnv := os.Getenv("JUJU_ENV") | 59 | defaultEnv := os.Getenv(osenv.JujuEnv) |
76 | 59 | if defaultEnv != "" { | 60 | if defaultEnv != "" { |
77 | 60 | return defaultEnv | 61 | return defaultEnv |
78 | 61 | } | 62 | } |
79 | 62 | 63 | ||
80 | === modified file 'cmd/juju/environmentcommand_test.go' | |||
81 | --- cmd/juju/environmentcommand_test.go 2013-05-10 20:55:57 +0000 | |||
82 | +++ cmd/juju/environmentcommand_test.go 2013-07-31 21:52:25 +0000 | |||
83 | @@ -8,6 +8,8 @@ | |||
84 | 8 | "os" | 8 | "os" |
85 | 9 | 9 | ||
86 | 10 | . "launchpad.net/gocheck" | 10 | . "launchpad.net/gocheck" |
87 | 11 | |||
88 | 12 | "launchpad.net/juju-core/juju/osenv" | ||
89 | 11 | "launchpad.net/juju-core/testing" | 13 | "launchpad.net/juju-core/testing" |
90 | 12 | ) | 14 | ) |
91 | 13 | 15 | ||
92 | @@ -50,13 +52,13 @@ | |||
93 | 50 | } | 52 | } |
94 | 51 | 53 | ||
95 | 52 | func (s *EnvironmentCommandSuite) TestGetDefaultEnvironmentJujuEnvSet(c *C) { | 54 | func (s *EnvironmentCommandSuite) TestGetDefaultEnvironmentJujuEnvSet(c *C) { |
97 | 53 | os.Setenv("JUJU_ENV", "magic") | 55 | os.Setenv(osenv.JujuEnv, "magic") |
98 | 54 | env := getDefaultEnvironment() | 56 | env := getDefaultEnvironment() |
99 | 55 | c.Assert(env, Equals, "magic") | 57 | c.Assert(env, Equals, "magic") |
100 | 56 | } | 58 | } |
101 | 57 | 59 | ||
102 | 58 | func (s *EnvironmentCommandSuite) TestGetDefaultEnvironmentBothSet(c *C) { | 60 | func (s *EnvironmentCommandSuite) TestGetDefaultEnvironmentBothSet(c *C) { |
104 | 59 | os.Setenv("JUJU_ENV", "magic") | 61 | os.Setenv(osenv.JujuEnv, "magic") |
105 | 60 | err := writeCurrentEnvironment("fubar") | 62 | err := writeCurrentEnvironment("fubar") |
106 | 61 | c.Assert(err, IsNil) | 63 | c.Assert(err, IsNil) |
107 | 62 | env := getDefaultEnvironment() | 64 | env := getDefaultEnvironment() |
108 | 63 | 65 | ||
109 | === modified file 'cmd/juju/main_test.go' | |||
110 | --- cmd/juju/main_test.go 2013-07-26 00:58:46 +0000 | |||
111 | +++ cmd/juju/main_test.go 2013-07-31 21:52:25 +0000 | |||
112 | @@ -8,19 +8,22 @@ | |||
113 | 8 | "flag" | 8 | "flag" |
114 | 9 | "fmt" | 9 | "fmt" |
115 | 10 | "io/ioutil" | 10 | "io/ioutil" |
116 | 11 | "os" | ||
117 | 12 | "os/exec" | ||
118 | 13 | "path/filepath" | ||
119 | 14 | "strings" | ||
120 | 15 | stdtesting "testing" | ||
121 | 16 | |||
122 | 11 | "launchpad.net/gnuflag" | 17 | "launchpad.net/gnuflag" |
123 | 12 | . "launchpad.net/gocheck" | 18 | . "launchpad.net/gocheck" |
124 | 19 | "launchpad.net/loggo" | ||
125 | 20 | |||
126 | 13 | "launchpad.net/juju-core/cmd" | 21 | "launchpad.net/juju-core/cmd" |
127 | 14 | "launchpad.net/juju-core/environs/config" | 22 | "launchpad.net/juju-core/environs/config" |
128 | 15 | _ "launchpad.net/juju-core/environs/dummy" | 23 | _ "launchpad.net/juju-core/environs/dummy" |
129 | 24 | "launchpad.net/juju-core/juju/osenv" | ||
130 | 16 | "launchpad.net/juju-core/testing" | 25 | "launchpad.net/juju-core/testing" |
131 | 17 | "launchpad.net/juju-core/version" | 26 | "launchpad.net/juju-core/version" |
132 | 18 | "launchpad.net/loggo" | ||
133 | 19 | "os" | ||
134 | 20 | "os/exec" | ||
135 | 21 | "path/filepath" | ||
136 | 22 | "strings" | ||
137 | 23 | stdtesting "testing" | ||
138 | 24 | ) | 27 | ) |
139 | 25 | 28 | ||
140 | 26 | func TestPackage(t *stdtesting.T) { | 29 | func TestPackage(t *stdtesting.T) { |
141 | @@ -46,7 +49,7 @@ | |||
142 | 46 | func badrun(c *C, exit int, args ...string) string { | 49 | func badrun(c *C, exit int, args ...string) string { |
143 | 47 | localArgs := append([]string{"-test.run", "TestRunMain", "-run-main", "--", "juju"}, args...) | 50 | localArgs := append([]string{"-test.run", "TestRunMain", "-run-main", "--", "juju"}, args...) |
144 | 48 | ps := exec.Command(os.Args[0], localArgs...) | 51 | ps := exec.Command(os.Args[0], localArgs...) |
146 | 49 | ps.Env = append(os.Environ(), "JUJU_HOME="+config.JujuHome()) | 52 | ps.Env = append(os.Environ(), osenv.JujuHome+"="+config.JujuHome()) |
147 | 50 | output, err := ps.CombinedOutput() | 53 | output, err := ps.CombinedOutput() |
148 | 51 | if exit != 0 { | 54 | if exit != 0 { |
149 | 52 | c.Assert(err, ErrorMatches, fmt.Sprintf("exit status %d", exit)) | 55 | c.Assert(err, ErrorMatches, fmt.Sprintf("exit status %d", exit)) |
150 | 53 | 56 | ||
151 | === modified file 'cmd/jujud/machine.go' | |||
152 | --- cmd/jujud/machine.go 2013-07-30 16:39:37 +0000 | |||
153 | +++ cmd/jujud/machine.go 2013-07-31 21:52:25 +0000 | |||
154 | @@ -17,6 +17,7 @@ | |||
155 | 17 | localstorage "launchpad.net/juju-core/environs/local/storage" | 17 | localstorage "launchpad.net/juju-core/environs/local/storage" |
156 | 18 | "launchpad.net/juju-core/environs/provider" | 18 | "launchpad.net/juju-core/environs/provider" |
157 | 19 | "launchpad.net/juju-core/instance" | 19 | "launchpad.net/juju-core/instance" |
158 | 20 | "launchpad.net/juju-core/juju/osenv" | ||
159 | 20 | "launchpad.net/juju-core/log" | 21 | "launchpad.net/juju-core/log" |
160 | 21 | "launchpad.net/juju-core/names" | 22 | "launchpad.net/juju-core/names" |
161 | 22 | "launchpad.net/juju-core/state" | 23 | "launchpad.net/juju-core/state" |
162 | @@ -222,7 +223,7 @@ | |||
163 | 222 | // containers, it is likely that we will want an LXC provisioner on a KVM | 223 | // containers, it is likely that we will want an LXC provisioner on a KVM |
164 | 223 | // machine, and once we get nested LXC containers, we can remove this | 224 | // machine, and once we get nested LXC containers, we can remove this |
165 | 224 | // check. | 225 | // check. |
167 | 225 | providerType := os.Getenv("JUJU_PROVIDER_TYPE") | 226 | providerType := os.Getenv(osenv.JujuProviderType) |
168 | 226 | if providerType != provider.Local && m.ContainerType() != instance.LXC { | 227 | if providerType != provider.Local && m.ContainerType() != instance.LXC { |
169 | 227 | workerName := fmt.Sprintf("%s-provisioner", provisioner.LXC) | 228 | workerName := fmt.Sprintf("%s-provisioner", provisioner.LXC) |
170 | 228 | runner.StartWorker(workerName, func() (worker.Worker, error) { | 229 | runner.StartWorker(workerName, func() (worker.Worker, error) { |
171 | 229 | 230 | ||
172 | === modified file 'cmd/jujud/upgradevalidation.go' | |||
173 | --- cmd/jujud/upgradevalidation.go 2013-07-30 16:30:58 +0000 | |||
174 | +++ cmd/jujud/upgradevalidation.go 2013-07-31 21:52:25 +0000 | |||
175 | @@ -14,6 +14,7 @@ | |||
176 | 14 | "launchpad.net/juju-core/container/lxc" | 14 | "launchpad.net/juju-core/container/lxc" |
177 | 15 | "launchpad.net/juju-core/environs/provider" | 15 | "launchpad.net/juju-core/environs/provider" |
178 | 16 | "launchpad.net/juju-core/instance" | 16 | "launchpad.net/juju-core/instance" |
179 | 17 | "launchpad.net/juju-core/juju/osenv" | ||
180 | 17 | "launchpad.net/juju-core/names" | 18 | "launchpad.net/juju-core/names" |
181 | 18 | "launchpad.net/juju-core/state" | 19 | "launchpad.net/juju-core/state" |
182 | 19 | "launchpad.net/juju-core/state/api" | 20 | "launchpad.net/juju-core/state/api" |
183 | @@ -66,7 +67,7 @@ | |||
184 | 66 | return err | 67 | return err |
185 | 67 | } | 68 | } |
186 | 68 | containerType := state.ContainerTypeFromId(id) | 69 | containerType := state.ContainerTypeFromId(id) |
188 | 69 | providerType := os.Getenv("JUJU_PROVIDER_TYPE") | 70 | providerType := os.Getenv(osenv.JujuProviderType) |
189 | 70 | if providerType == provider.Local || containerType == instance.LXC { | 71 | if providerType == provider.Local || containerType == instance.LXC { |
190 | 71 | return nil | 72 | return nil |
191 | 72 | } | 73 | } |
192 | 73 | 74 | ||
193 | === modified file 'environs/azure/customdata_test.go' | |||
194 | --- environs/azure/customdata_test.go 2013-07-29 15:15:41 +0000 | |||
195 | +++ environs/azure/customdata_test.go 2013-07-31 21:52:25 +0000 | |||
196 | @@ -40,7 +40,6 @@ | |||
197 | 40 | Addrs: []string{"127.0.0.1:123"}, | 40 | Addrs: []string{"127.0.0.1:123"}, |
198 | 41 | Tag: names.MachineTag(machineID), | 41 | Tag: names.MachineTag(machineID), |
199 | 42 | }, | 42 | }, |
200 | 43 | ProviderType: "azure", | ||
201 | 44 | } | 43 | } |
202 | 45 | } | 44 | } |
203 | 46 | 45 | ||
204 | 47 | 46 | ||
205 | === modified file 'environs/cloudinit.go' | |||
206 | --- environs/cloudinit.go 2013-07-19 18:26:41 +0000 | |||
207 | +++ environs/cloudinit.go 2013-07-31 21:52:25 +0000 | |||
208 | @@ -10,6 +10,7 @@ | |||
209 | 10 | "launchpad.net/juju-core/constraints" | 10 | "launchpad.net/juju-core/constraints" |
210 | 11 | "launchpad.net/juju-core/environs/cloudinit" | 11 | "launchpad.net/juju-core/environs/cloudinit" |
211 | 12 | "launchpad.net/juju-core/environs/config" | 12 | "launchpad.net/juju-core/environs/config" |
212 | 13 | "launchpad.net/juju-core/juju/osenv" | ||
213 | 13 | "launchpad.net/juju-core/state" | 14 | "launchpad.net/juju-core/state" |
214 | 14 | "launchpad.net/juju-core/state/api" | 15 | "launchpad.net/juju-core/state/api" |
215 | 15 | "launchpad.net/juju-core/utils" | 16 | "launchpad.net/juju-core/utils" |
216 | @@ -69,7 +70,10 @@ | |||
217 | 69 | return fmt.Errorf("environment configuration has no authorized-keys") | 70 | return fmt.Errorf("environment configuration has no authorized-keys") |
218 | 70 | } | 71 | } |
219 | 71 | mcfg.AuthorizedKeys = authKeys | 72 | mcfg.AuthorizedKeys = authKeys |
221 | 72 | mcfg.ProviderType = cfg.Type() | 73 | if mcfg.MachineEnvironment == nil { |
222 | 74 | mcfg.MachineEnvironment = make(map[string]string) | ||
223 | 75 | } | ||
224 | 76 | mcfg.MachineEnvironment[osenv.JujuProviderType] = cfg.Type() | ||
225 | 73 | if !mcfg.StateServer { | 77 | if !mcfg.StateServer { |
226 | 74 | return nil | 78 | return nil |
227 | 75 | } | 79 | } |
228 | 76 | 80 | ||
229 | === modified file 'environs/cloudinit/cloudinit.go' | |||
230 | --- environs/cloudinit/cloudinit.go 2013-07-30 16:30:58 +0000 | |||
231 | +++ environs/cloudinit/cloudinit.go 2013-07-31 21:52:25 +0000 | |||
232 | @@ -92,8 +92,9 @@ | |||
233 | 92 | // commands cannot work. | 92 | // commands cannot work. |
234 | 93 | AuthorizedKeys string | 93 | AuthorizedKeys string |
235 | 94 | 94 | ||
238 | 95 | // ProviderType refers to the type of the provider that created the machine. | 95 | // MachineEnvironment defines additional environment variables to set in |
239 | 96 | ProviderType string | 96 | // the machine agent upstart script. |
240 | 97 | MachineEnvironment map[string]string | ||
241 | 97 | 98 | ||
242 | 98 | // Config holds the initial environment configuration. | 99 | // Config holds the initial environment configuration. |
243 | 99 | Config *config.Config | 100 | Config *config.Config |
244 | @@ -292,7 +293,7 @@ | |||
245 | 292 | addScripts(c, fmt.Sprintf("ln -s %v %s", cfg.Tools.Version, shquote(toolsDir))) | 293 | addScripts(c, fmt.Sprintf("ln -s %v %s", cfg.Tools.Version, shquote(toolsDir))) |
246 | 293 | 294 | ||
247 | 294 | name := "jujud-" + tag | 295 | name := "jujud-" + tag |
249 | 295 | conf := upstart.MachineAgentUpstartService(name, toolsDir, cfg.DataDir, "/var/log/juju/", tag, machineId, logConfig, cfg.ProviderType) | 296 | conf := upstart.MachineAgentUpstartService(name, toolsDir, cfg.DataDir, "/var/log/juju/", tag, machineId, logConfig, cfg.MachineEnvironment) |
250 | 296 | cmds, err := conf.InstallCommands() | 297 | cmds, err := conf.InstallCommands() |
251 | 297 | if err != nil { | 298 | if err != nil { |
252 | 298 | return fmt.Errorf("cannot make cloud-init upstart script for the %s agent: %v", tag, err) | 299 | return fmt.Errorf("cannot make cloud-init upstart script for the %s agent: %v", tag, err) |
253 | @@ -398,9 +399,6 @@ | |||
254 | 398 | if len(cfg.APIInfo.CACert) == 0 { | 399 | if len(cfg.APIInfo.CACert) == 0 { |
255 | 399 | return fmt.Errorf("missing API CA certificate") | 400 | return fmt.Errorf("missing API CA certificate") |
256 | 400 | } | 401 | } |
257 | 401 | if cfg.ProviderType == "" { | ||
258 | 402 | return fmt.Errorf("missing provider type") | ||
259 | 403 | } | ||
260 | 404 | if cfg.StateServer { | 402 | if cfg.StateServer { |
261 | 405 | if cfg.Config == nil { | 403 | if cfg.Config == nil { |
262 | 406 | return fmt.Errorf("missing environment configuration") | 404 | return fmt.Errorf("missing environment configuration") |
263 | 407 | 405 | ||
264 | === modified file 'environs/cloudinit/cloudinit_test.go' | |||
265 | --- environs/cloudinit/cloudinit_test.go 2013-07-24 16:08:50 +0000 | |||
266 | +++ environs/cloudinit/cloudinit_test.go 2013-07-31 21:52:25 +0000 | |||
267 | @@ -17,6 +17,7 @@ | |||
268 | 17 | "launchpad.net/juju-core/environs" | 17 | "launchpad.net/juju-core/environs" |
269 | 18 | "launchpad.net/juju-core/environs/cloudinit" | 18 | "launchpad.net/juju-core/environs/cloudinit" |
270 | 19 | "launchpad.net/juju-core/environs/config" | 19 | "launchpad.net/juju-core/environs/config" |
271 | 20 | "launchpad.net/juju-core/juju/osenv" | ||
272 | 20 | "launchpad.net/juju-core/state" | 21 | "launchpad.net/juju-core/state" |
273 | 21 | "launchpad.net/juju-core/state/api" | 22 | "launchpad.net/juju-core/state/api" |
274 | 22 | "launchpad.net/juju-core/testing" | 23 | "launchpad.net/juju-core/testing" |
275 | @@ -58,9 +59,9 @@ | |||
276 | 58 | { | 59 | { |
277 | 59 | // precise state server | 60 | // precise state server |
278 | 60 | cfg: cloudinit.MachineConfig{ | 61 | cfg: cloudinit.MachineConfig{ |
282 | 61 | MachineId: "0", | 62 | MachineId: "0", |
283 | 62 | AuthorizedKeys: "sshkey1", | 63 | AuthorizedKeys: "sshkey1", |
284 | 63 | ProviderType: "dummy", | 64 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
285 | 64 | // precise currently needs mongo from PPA | 65 | // precise currently needs mongo from PPA |
286 | 65 | Tools: newSimpleTools("1.2.3-precise-amd64"), | 66 | Tools: newSimpleTools("1.2.3-precise-amd64"), |
287 | 66 | StateServer: true, | 67 | StateServer: true, |
288 | @@ -116,9 +117,9 @@ | |||
289 | 116 | }, { | 117 | }, { |
290 | 117 | // raring state server | 118 | // raring state server |
291 | 118 | cfg: cloudinit.MachineConfig{ | 119 | cfg: cloudinit.MachineConfig{ |
295 | 119 | MachineId: "0", | 120 | MachineId: "0", |
296 | 120 | AuthorizedKeys: "sshkey1", | 121 | AuthorizedKeys: "sshkey1", |
297 | 121 | ProviderType: "dummy", | 122 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
298 | 122 | // raring provides mongo in the archive | 123 | // raring provides mongo in the archive |
299 | 123 | Tools: newSimpleTools("1.2.3-raring-amd64"), | 124 | Tools: newSimpleTools("1.2.3-raring-amd64"), |
300 | 124 | StateServer: true, | 125 | StateServer: true, |
301 | @@ -173,13 +174,13 @@ | |||
302 | 173 | `, | 174 | `, |
303 | 174 | }, { | 175 | }, { |
304 | 175 | cfg: cloudinit.MachineConfig{ | 176 | cfg: cloudinit.MachineConfig{ |
312 | 176 | MachineId: "99", | 177 | MachineId: "99", |
313 | 177 | AuthorizedKeys: "sshkey1", | 178 | AuthorizedKeys: "sshkey1", |
314 | 178 | ProviderType: "dummy", | 179 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
315 | 179 | DataDir: environs.DataDir, | 180 | DataDir: environs.DataDir, |
316 | 180 | StateServer: false, | 181 | StateServer: false, |
317 | 181 | Tools: newSimpleTools("1.2.3-linux-amd64"), | 182 | Tools: newSimpleTools("1.2.3-linux-amd64"), |
318 | 182 | MachineNonce: "FAKE_NONCE", | 183 | MachineNonce: "FAKE_NONCE", |
319 | 183 | StateInfo: &state.Info{ | 184 | StateInfo: &state.Info{ |
320 | 184 | Addrs: []string{"state-addr.testing.invalid:12345"}, | 185 | Addrs: []string{"state-addr.testing.invalid:12345"}, |
321 | 185 | Tag: "machine-99", | 186 | Tag: "machine-99", |
322 | @@ -215,7 +216,7 @@ | |||
323 | 215 | MachineId: "2/lxc/1", | 216 | MachineId: "2/lxc/1", |
324 | 216 | MachineContainerType: "lxc", | 217 | MachineContainerType: "lxc", |
325 | 217 | AuthorizedKeys: "sshkey1", | 218 | AuthorizedKeys: "sshkey1", |
327 | 218 | ProviderType: "dummy", | 219 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
328 | 219 | DataDir: environs.DataDir, | 220 | DataDir: environs.DataDir, |
329 | 220 | StateServer: false, | 221 | StateServer: false, |
330 | 221 | Tools: newSimpleTools("1.2.3-linux-amd64"), | 222 | Tools: newSimpleTools("1.2.3-linux-amd64"), |
331 | @@ -557,15 +558,15 @@ | |||
332 | 557 | // checked for by NewCloudInit. | 558 | // checked for by NewCloudInit. |
333 | 558 | func (*cloudinitSuite) TestCloudInitVerify(c *C) { | 559 | func (*cloudinitSuite) TestCloudInitVerify(c *C) { |
334 | 559 | cfg := &cloudinit.MachineConfig{ | 560 | cfg := &cloudinit.MachineConfig{ |
344 | 560 | StateServer: true, | 561 | StateServer: true, |
345 | 561 | StateServerCert: serverCert, | 562 | StateServerCert: serverCert, |
346 | 562 | StateServerKey: serverKey, | 563 | StateServerKey: serverKey, |
347 | 563 | StatePort: 1234, | 564 | StatePort: 1234, |
348 | 564 | APIPort: 1235, | 565 | APIPort: 1235, |
349 | 565 | MachineId: "99", | 566 | MachineId: "99", |
350 | 566 | Tools: newSimpleTools("9.9.9-linux-arble"), | 567 | Tools: newSimpleTools("9.9.9-linux-arble"), |
351 | 567 | AuthorizedKeys: "sshkey1", | 568 | AuthorizedKeys: "sshkey1", |
352 | 568 | ProviderType: "dummy", | 569 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
353 | 569 | StateInfo: &state.Info{ | 570 | StateInfo: &state.Info{ |
354 | 570 | Addrs: []string{"host:98765"}, | 571 | Addrs: []string{"host:98765"}, |
355 | 571 | CACert: []byte(testing.CACert), | 572 | CACert: []byte(testing.CACert), |
356 | 572 | 573 | ||
357 | === modified file 'environs/cloudinit_test.go' | |||
358 | --- environs/cloudinit_test.go 2013-07-24 16:08:50 +0000 | |||
359 | +++ environs/cloudinit_test.go 2013-07-31 21:52:25 +0000 | |||
360 | @@ -15,6 +15,7 @@ | |||
361 | 15 | "launchpad.net/juju-core/environs" | 15 | "launchpad.net/juju-core/environs" |
362 | 16 | "launchpad.net/juju-core/environs/cloudinit" | 16 | "launchpad.net/juju-core/environs/cloudinit" |
363 | 17 | "launchpad.net/juju-core/environs/config" | 17 | "launchpad.net/juju-core/environs/config" |
364 | 18 | "launchpad.net/juju-core/juju/osenv" | ||
365 | 18 | "launchpad.net/juju-core/state" | 19 | "launchpad.net/juju-core/state" |
366 | 19 | "launchpad.net/juju-core/state/api" | 20 | "launchpad.net/juju-core/state/api" |
367 | 20 | "launchpad.net/juju-core/testing" | 21 | "launchpad.net/juju-core/testing" |
368 | @@ -42,10 +43,10 @@ | |||
369 | 42 | err = environs.FinishMachineConfig(mcfg, cfg, constraints.Value{}) | 43 | err = environs.FinishMachineConfig(mcfg, cfg, constraints.Value{}) |
370 | 43 | c.Assert(err, IsNil) | 44 | c.Assert(err, IsNil) |
371 | 44 | c.Assert(mcfg, DeepEquals, &cloudinit.MachineConfig{ | 45 | c.Assert(mcfg, DeepEquals, &cloudinit.MachineConfig{ |
376 | 45 | AuthorizedKeys: "we-are-the-keys", | 46 | AuthorizedKeys: "we-are-the-keys", |
377 | 46 | ProviderType: "dummy", | 47 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
378 | 47 | StateInfo: &state.Info{Tag: "not touched"}, | 48 | StateInfo: &state.Info{Tag: "not touched"}, |
379 | 48 | APIInfo: &api.Info{Tag: "not touched"}, | 49 | APIInfo: &api.Info{Tag: "not touched"}, |
380 | 49 | }) | 50 | }) |
381 | 50 | } | 51 | } |
382 | 51 | 52 | ||
383 | @@ -128,12 +129,12 @@ | |||
384 | 128 | Password: "pw2", | 129 | Password: "pw2", |
385 | 129 | CACert: []byte("CA CERT\n" + testing.CACert), | 130 | CACert: []byte("CA CERT\n" + testing.CACert), |
386 | 130 | }, | 131 | }, |
393 | 131 | DataDir: environs.DataDir, | 132 | DataDir: environs.DataDir, |
394 | 132 | Config: envConfig, | 133 | Config: envConfig, |
395 | 133 | StatePort: envConfig.StatePort(), | 134 | StatePort: envConfig.StatePort(), |
396 | 134 | APIPort: envConfig.APIPort(), | 135 | APIPort: envConfig.APIPort(), |
397 | 135 | StateServer: true, | 136 | StateServer: true, |
398 | 136 | ProviderType: "dummy", | 137 | MachineEnvironment: map[string]string{osenv.JujuProviderType: "dummy"}, |
399 | 137 | } | 138 | } |
400 | 138 | script1 := "script1" | 139 | script1 := "script1" |
401 | 139 | script2 := "script2" | 140 | script2 := "script2" |
402 | 140 | 141 | ||
403 | === modified file 'environs/local/environ.go' | |||
404 | --- environs/local/environ.go 2013-07-30 16:39:37 +0000 | |||
405 | +++ environs/local/environ.go 2013-07-31 21:52:25 +0000 | |||
406 | @@ -21,6 +21,7 @@ | |||
407 | 21 | "launchpad.net/juju-core/environs/config" | 21 | "launchpad.net/juju-core/environs/config" |
408 | 22 | "launchpad.net/juju-core/environs/localstorage" | 22 | "launchpad.net/juju-core/environs/localstorage" |
409 | 23 | "launchpad.net/juju-core/instance" | 23 | "launchpad.net/juju-core/instance" |
410 | 24 | "launchpad.net/juju-core/juju/osenv" | ||
411 | 24 | "launchpad.net/juju-core/names" | 25 | "launchpad.net/juju-core/names" |
412 | 25 | "launchpad.net/juju-core/state" | 26 | "launchpad.net/juju-core/state" |
413 | 26 | "launchpad.net/juju-core/state/api" | 27 | "launchpad.net/juju-core/state/api" |
414 | @@ -464,15 +465,18 @@ | |||
415 | 464 | toolsDir := tools.SharedToolsDir(dataDir, agentTools.Version) | 465 | toolsDir := tools.SharedToolsDir(dataDir, agentTools.Version) |
416 | 465 | logDir := env.config.logDir() | 466 | logDir := env.config.logDir() |
417 | 466 | logConfig := "--debug" // TODO(thumper): specify loggo config | 467 | logConfig := "--debug" // TODO(thumper): specify loggo config |
418 | 468 | machineEnvironment := map[string]string{ | ||
419 | 469 | "USER": env.config.user, | ||
420 | 470 | "HOME": os.Getenv("HOME"), | ||
421 | 471 | osenv.JujuProviderType: env.config.Type(), | ||
422 | 472 | osenv.JujuStorageDir: env.config.storageDir(), | ||
423 | 473 | osenv.JujuStorageAddr: env.config.storageAddr(), | ||
424 | 474 | osenv.JujuSharedStorageDir: env.config.sharedStorageDir(), | ||
425 | 475 | osenv.JujuSharedStorageAddr: env.config.sharedStorageAddr(), | ||
426 | 476 | } | ||
427 | 467 | agent := upstart.MachineAgentUpstartService( | 477 | agent := upstart.MachineAgentUpstartService( |
428 | 468 | env.machineAgentServiceName(), | 478 | env.machineAgentServiceName(), |
436 | 469 | toolsDir, dataDir, logDir, tag, machineId, logConfig, env.config.Type()) | 479 | toolsDir, dataDir, logDir, tag, machineId, logConfig, machineEnvironment) |
430 | 470 | agent.Env["USER"] = env.config.user | ||
431 | 471 | agent.Env["HOME"] = os.Getenv("HOME") | ||
432 | 472 | agent.Env["JUJU_STORAGE_DIR"] = env.config.storageDir() | ||
433 | 473 | agent.Env["JUJU_STORAGE_ADDR"] = env.config.storageAddr() | ||
434 | 474 | agent.Env["JUJU_SHARED_STORAGE_DIR"] = env.config.sharedStorageDir() | ||
435 | 475 | agent.Env["JUJU_SHARED_STORAGE_ADDR"] = env.config.sharedStorageAddr() | ||
437 | 476 | 480 | ||
438 | 477 | agent.InitDir = upstartScriptLocation | 481 | agent.InitDir = upstartScriptLocation |
439 | 478 | logger.Infof("installing service %s to %s", env.machineAgentServiceName(), agent.InitDir) | 482 | logger.Infof("installing service %s to %s", env.machineAgentServiceName(), agent.InitDir) |
440 | 479 | 483 | ||
441 | === modified file 'environs/local/storage/worker.go' | |||
442 | --- environs/local/storage/worker.go 2013-07-16 02:09:30 +0000 | |||
443 | +++ environs/local/storage/worker.go 2013-07-31 21:52:25 +0000 | |||
444 | @@ -7,6 +7,7 @@ | |||
445 | 7 | "launchpad.net/tomb" | 7 | "launchpad.net/tomb" |
446 | 8 | 8 | ||
447 | 9 | "launchpad.net/juju-core/environs/localstorage" | 9 | "launchpad.net/juju-core/environs/localstorage" |
448 | 10 | "launchpad.net/juju-core/juju/osenv" | ||
449 | 10 | "launchpad.net/juju-core/worker" | 11 | "launchpad.net/juju-core/worker" |
450 | 11 | ) | 12 | ) |
451 | 12 | 13 | ||
452 | @@ -36,8 +37,8 @@ | |||
453 | 36 | } | 37 | } |
454 | 37 | 38 | ||
455 | 38 | func (s *storageWorker) waitForDeath() error { | 39 | func (s *storageWorker) waitForDeath() error { |
458 | 39 | storageDir := os.Getenv("JUJU_STORAGE_DIR") | 40 | storageDir := os.Getenv(osenv.JujuStorageDir) |
459 | 40 | storageAddr := os.Getenv("JUJU_STORAGE_ADDR") | 41 | storageAddr := os.Getenv(osenv.JujuStorageAddr) |
460 | 41 | logger.Infof("serving %s on %s", storageDir, storageAddr) | 42 | logger.Infof("serving %s on %s", storageDir, storageAddr) |
461 | 42 | 43 | ||
462 | 43 | storageListener, err := localstorage.Serve(storageAddr, storageDir) | 44 | storageListener, err := localstorage.Serve(storageAddr, storageDir) |
463 | @@ -47,8 +48,8 @@ | |||
464 | 47 | } | 48 | } |
465 | 48 | defer storageListener.Close() | 49 | defer storageListener.Close() |
466 | 49 | 50 | ||
469 | 50 | sharedStorageDir := os.Getenv("JUJU_SHARED_STORAGE_DIR") | 51 | sharedStorageDir := os.Getenv(osenv.JujuSharedStorageDir) |
470 | 51 | sharedStorageAddr := os.Getenv("JUJU_SHARED_STORAGE_ADDR") | 52 | sharedStorageAddr := os.Getenv(osenv.JujuSharedStorageAddr) |
471 | 52 | logger.Infof("serving %s on %s", sharedStorageDir, sharedStorageAddr) | 53 | logger.Infof("serving %s on %s", sharedStorageDir, sharedStorageAddr) |
472 | 53 | 54 | ||
473 | 54 | sharedStorageListener, err := localstorage.Serve(sharedStorageAddr, sharedStorageDir) | 55 | sharedStorageListener, err := localstorage.Serve(sharedStorageAddr, sharedStorageDir) |
474 | 55 | 56 | ||
475 | === added directory 'juju/osenv' | |||
476 | === added file 'juju/osenv/package_test.go' | |||
477 | --- juju/osenv/package_test.go 1970-01-01 00:00:00 +0000 | |||
478 | +++ juju/osenv/package_test.go 2013-07-31 21:52:25 +0000 | |||
479 | @@ -0,0 +1,14 @@ | |||
480 | 1 | // Copyright 2013 Canonical Ltd. | ||
481 | 2 | // Licensed under the AGPLv3, see LICENCE file for details. | ||
482 | 3 | |||
483 | 4 | package osenv_test | ||
484 | 5 | |||
485 | 6 | import ( | ||
486 | 7 | "testing" | ||
487 | 8 | |||
488 | 9 | gc "launchpad.net/gocheck" | ||
489 | 10 | ) | ||
490 | 11 | |||
491 | 12 | func Test(t *testing.T) { | ||
492 | 13 | gc.TestingT(t) | ||
493 | 14 | } | ||
494 | 0 | 15 | ||
495 | === added file 'juju/osenv/vars.go' | |||
496 | --- juju/osenv/vars.go 1970-01-01 00:00:00 +0000 | |||
497 | +++ juju/osenv/vars.go 2013-07-31 21:52:25 +0000 | |||
498 | @@ -0,0 +1,16 @@ | |||
499 | 1 | // Copyright 2013 Canonical Ltd. | ||
500 | 2 | // Licensed under the AGPLv3, see LICENCE file for details. | ||
501 | 3 | |||
502 | 4 | package osenv | ||
503 | 5 | |||
504 | 6 | const ( | ||
505 | 7 | JujuEnv = "JUJU_ENV" | ||
506 | 8 | JujuHome = "JUJU_HOME" | ||
507 | 9 | JujuRepository = "JUJU_REPOSITORY" | ||
508 | 10 | JujuLxcBridge = "JUJU_LXC_BRIDGE" | ||
509 | 11 | JujuProviderType = "JUJU_PROVIDER_TYPE" | ||
510 | 12 | JujuStorageDir = "JUJU_STORAGE_DIR" | ||
511 | 13 | JujuStorageAddr = "JUJU_STORAGE_ADDR" | ||
512 | 14 | JujuSharedStorageDir = "JUJU_SHARED_STORAGE_DIR" | ||
513 | 15 | JujuSharedStorageAddr = "JUJU_SHARED_STORAGE_ADDR" | ||
514 | 16 | ) | ||
515 | 0 | 17 | ||
516 | === added file 'juju/osenv/vars_test.go' | |||
517 | --- juju/osenv/vars_test.go 1970-01-01 00:00:00 +0000 | |||
518 | +++ juju/osenv/vars_test.go 2013-07-31 21:52:25 +0000 | |||
519 | @@ -0,0 +1,20 @@ | |||
520 | 1 | // Copyright 2013 Canonical Ltd. | ||
521 | 2 | // Licensed under the AGPLv3, see LICENCE file for details. | ||
522 | 3 | |||
523 | 4 | package osenv_test | ||
524 | 5 | |||
525 | 6 | import ( | ||
526 | 7 | gc "launchpad.net/gocheck" | ||
527 | 8 | |||
528 | 9 | "launchpad.net/juju-core/testing" | ||
529 | 10 | ) | ||
530 | 11 | |||
531 | 12 | type importSuite struct{} | ||
532 | 13 | |||
533 | 14 | var _ = gc.Suite(&importSuite{}) | ||
534 | 15 | |||
535 | 16 | func (*importSuite) TestDependencies(c *gc.C) { | ||
536 | 17 | // This test is to ensure we don't bring in dependencies at all. | ||
537 | 18 | c.Assert(testing.FindJujuCoreImports(c, "launchpad.net/juju-core/juju/osenv"), | ||
538 | 19 | gc.HasLen, 0) | ||
539 | 20 | } | ||
540 | 0 | 21 | ||
541 | === modified file 'upstart/service.go' | |||
542 | --- upstart/service.go 2013-07-16 06:29:04 +0000 | |||
543 | +++ upstart/service.go 2013-07-31 21:52:25 +0000 | |||
544 | @@ -42,7 +42,7 @@ | |||
545 | 42 | 42 | ||
546 | 43 | // MachineAgentUpstartService returns the upstart config for a machine agent | 43 | // MachineAgentUpstartService returns the upstart config for a machine agent |
547 | 44 | // based on the tag and machineId passed in. | 44 | // based on the tag and machineId passed in. |
549 | 45 | func MachineAgentUpstartService(name, toolsDir, dataDir, logDir, tag, machineId, logConfig, providerType string) *Conf { | 45 | func MachineAgentUpstartService(name, toolsDir, dataDir, logDir, tag, machineId, logConfig string, env map[string]string) *Conf { |
550 | 46 | svc := NewService(name) | 46 | svc := NewService(name) |
551 | 47 | logFile := filepath.Join(logDir, tag+".log") | 47 | logFile := filepath.Join(logDir, tag+".log") |
552 | 48 | return &Conf{ | 48 | return &Conf{ |
553 | @@ -58,8 +58,6 @@ | |||
554 | 58 | " --machine-id " + machineId + | 58 | " --machine-id " + machineId + |
555 | 59 | " " + logConfig, | 59 | " " + logConfig, |
556 | 60 | Out: logFile, | 60 | Out: logFile, |
560 | 61 | Env: map[string]string{ | 61 | Env: env, |
558 | 62 | "JUJU_PROVIDER_TYPE": providerType, | ||
559 | 63 | }, | ||
561 | 64 | } | 62 | } |
562 | 65 | } | 63 | } |
563 | 66 | 64 | ||
564 | === modified file 'worker/deployer/simple.go' | |||
565 | --- worker/deployer/simple.go 2013-07-30 14:00:53 +0000 | |||
566 | +++ worker/deployer/simple.go 2013-07-31 21:52:25 +0000 | |||
567 | @@ -13,6 +13,7 @@ | |||
568 | 13 | 13 | ||
569 | 14 | "launchpad.net/juju-core/agent" | 14 | "launchpad.net/juju-core/agent" |
570 | 15 | "launchpad.net/juju-core/agent/tools" | 15 | "launchpad.net/juju-core/agent/tools" |
571 | 16 | "launchpad.net/juju-core/juju/osenv" | ||
572 | 16 | "launchpad.net/juju-core/log/syslog" | 17 | "launchpad.net/juju-core/log/syslog" |
573 | 17 | "launchpad.net/juju-core/names" | 18 | "launchpad.net/juju-core/names" |
574 | 18 | "launchpad.net/juju-core/state" // Only because of state.Info | 19 | "launchpad.net/juju-core/state" // Only because of state.Info |
575 | @@ -148,7 +149,7 @@ | |||
576 | 148 | Out: logPath, | 149 | Out: logPath, |
577 | 149 | // Propagate the provider type enviroment variable. | 150 | // Propagate the provider type enviroment variable. |
578 | 150 | Env: map[string]string{ | 151 | Env: map[string]string{ |
580 | 151 | "JUJU_PROVIDER_TYPE": os.Getenv("JUJU_PROVIDER_TYPE"), | 152 | osenv.JujuProviderType: os.Getenv(osenv.JujuProviderType), |
581 | 152 | }, | 153 | }, |
582 | 153 | } | 154 | } |
583 | 154 | return uconf.Install() | 155 | return uconf.Install() |
Reviewers: mp+177707_ code.launchpad. net,
Message:
Please take a look.
Description:
Use a map to store machine environment in config.
The MachineConfig now uses a map to store the environment
for the machine agent.
https:/ /code.launchpad .net/~thumper/ juju-core/ machine- agent-environme nt/+merge/ 177707
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/12005048/
Affected files: azure/customdat a_test. go cloudinit. go cloudinit/ cloudinit. go cloudinit/ cloudinit_ test.go cloudinit_ test.go local/environ. go
A [revision details]
M environs/
M environs/
M environs/
M environs/
M environs/
M environs/
M upstart/service.go