Merge lp:~thumper/juju-core/bootstrap-state-no-constraints into lp:juju-core/1.16
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1972 |
Proposed branch: | lp:~thumper/juju-core/bootstrap-state-no-constraints |
Merge into: | lp:juju-core/1.16 |
Diff against target: |
102 lines (+74/-1) 2 files modified
environs/cloudinit/cloudinit.go (+5/-1) environs/cloudinit/cloudinit_test.go (+69/-0) |
To merge this branch: | bzr merge lp:~thumper/juju-core/bootstrap-state-no-constraints |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+190852@code.launchpad.net |
Commit message
Don't pass through empty constraints
If there are no constraints to pass through, cloud init has
--constraints ''
It seems that somewhere in the process, the empty param is
getting missed and the following --debug param is getting
parsed as a constraint value.
The test is horrible, and all we really care about is the
jujud bootstrap-state line.
See also: lp:1239508 and lp:1239509
Description of the change
Don't pass through empty constraints
If there are no constraints to pass through, cloud init has
--constraints ''
It seems that somewhere in the process, the empty param is
getting missed and the following --debug param is getting
parsed as a constraint value.
The test is horrible, and all we really care about is the
jujud bootstrap-state line.
See also: lp:1239508 and lp:1239509
Reviewers: mp+190852_ code.launchpad. net,
Message:
Please take a look.
Description:
Don't pass through empty constraints
If there are no constraints to pass through, cloud init has
--constraints ''
It seems that somewhere in the process, the empty param is
getting missed and the following --debug param is getting
parsed as a constraint value.
The test is horrible, and all we really care about is the
jujud bootstrap-state line.
See also: lp:1239508 and lp:1239509
https:/ /code.launchpad .net/~thumper/ juju-core/ bootstrap- state-no- constraints/ +merge/ 190852
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14516056/
Affected files (+76, -1 lines): cloudinit/ cloudinit. go cloudinit/ cloudinit_ test.go
A [revision details]
M environs/
M environs/
Index: [revision details] 20131010031125- 8lgphpzdl93berr 7
=== 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 2013-10-03 09:45:30 +0000 cloudinit/ cloudinit. go 2013-10-14 03:13:55 +0000 .String( ) Sprintf( "echo %s > %s", shquote( cfg.StateInfoUR L), RLFile) , jujuTools( )+"/jujud bootstrap-state"+ cfg.DataDir) + base64yaml( cfg.Config) )+ cfg.Constraints .String( ))+ acfg.Dir( )),
=== modified file 'environs/
--- environs/
+++ environs/
@@ -217,13 +217,17 @@
if err != nil {
return nil, err
}
+ cons := cfg.Constraints
+ if cons != "" {
+ cons = " --constraints " + shquote(cons)
+ }
c.AddScripts(
fmt.
BootstrapStateU
// The bootstrapping is always run with debug on.
cfg.
" --data-dir "+shquote(
" --env-config "+shquote(
- " --constraints "+shquote(
+ cons+
" --debug",
"rm -rf "+shquote(
)
Index: environs/ cloudinit/ cloudinit_ test.go cloudinit/ cloudinit_ test.go' cloudinit/ cloudinit_ test.go 2013-10-03 09:45:30 +0000 cloudinit/ cloudinit_ test.go 2013-10-14 03:13:55 +0000 MachineConfig{ string{ agent.ProviderT ype: "dummy"}, "1.2.3- precise- amd64") , mongodb
=== modified file 'environs/
--- environs/
+++ environs/
@@ -120,6 +120,75 @@
start jujud-machine-0
`,
}, {
+ // NOTE: this is terrible, only want to test part of the results...
+ // precise state server - no constraints
+ cfg: cloudinit.
+ MachineId: "0",
+ AuthorizedKeys: "sshkey1",
+ AgentEnvironment: map[string]
+ // precise currently needs mongo from PPA
+ Tools: newSimpleTools(
+ StateServer: true,
+ StateServerCert: serverCert,
+ StateServerKey: serverKey,
+ StatePort: 37017,
+ APIPort: 17070,
+ MachineNonce: "FAKE_NONCE",
+ StateInfo: &state.Info{
+ Password: "arble",
+ CACert: []byte("CA CERT\n" + testing.CACert),
+ },
+ APIInfo: &api.Info{
+ Password: "bletch",
+ CACert: []byte("CA CERT\n" + testing.CACert),
+ },
+ DataDir: environs.DataDir,
+ StateInfoURL: "some-url",
+ },
+ setEnvConfig: true,
+ expectScripts: `
+echo ENABLE_MONGODB="no" > /etc/default/
+set -xe
...