Merge lp:~wallyworld/juju-core/bootstrap-supported-series into lp:~go-bot/juju-core/trunk

Proposed by Ian Booth
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 2676
Proposed branch: lp:~wallyworld/juju-core/bootstrap-supported-series
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 99 lines (+19/-8)
3 files modified
cmd/juju/bootstrap_test.go (+11/-6)
environs/bootstrap/bootstrap_test.go (+1/-1)
environs/bootstrap/synctools.go (+7/-1)
To merge this branch: bzr merge lp:~wallyworld/juju-core/bootstrap-supported-series
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+216974@code.launchpad.net

Commit message

Upload tools for all lts series

When --upload-tools is used, and no series is
explicitly specified by the user, we were
uploading tools just for the latest lts series.
But we really want tools for all supported lts
series to be uploaded.

https://codereview.appspot.com/97720043/

Description of the change

Upload tools for all lts series

When --upload-tools is used, and no series is
explicitly specified by the user, we were
uploading tools just for the latest lts series.
But we really want tools for all supported lts
series to be uploaded.

https://codereview.appspot.com/97720043/

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Reviewers: mp+216974_code.launchpad.net,

Message:
Please take a look.

Description:
Upload tools for all lts series

When --upload-tools is used, and no series is
explicitly specified by the user, we were
uploading tools just for the latest lts series.
But we really want tools for all supported lts
series to be uploaded.

https://code.launchpad.net/~wallyworld/juju-core/bootstrap-supported-series/+merge/216974

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/97720043/

Affected files (+10, -2 lines):
   A [revision details]
   M environs/bootstrap/bootstrap_test.go
   M environs/bootstrap/synctools.go

Index: [revision details]
=== 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-20140424033650-9am3xzxfcelms2x8
+New revision: <email address hidden>

Index: environs/bootstrap/bootstrap_test.go
=== modified file 'environs/bootstrap/bootstrap_test.go'
--- environs/bootstrap/bootstrap_test.go 2014-04-17 09:42:34 +0000
+++ environs/bootstrap/bootstrap_test.go 2014-04-24 04:01:26 +0000
@@ -352,7 +352,7 @@
   c.Assert(bootstrap.SeriesToUpload(cfg, []string{"quantal"}),
jc.SameContents, []string{"quantal"})
   env = newEnviron("foo", useDefaultKeys,
map[string]interface{}{"default-series": "lucid"})
   cfg = env.Config()
- c.Assert(bootstrap.SeriesToUpload(cfg, nil), jc.SameContents,
[]string{"quantal", config.LatestLtsSeries(), "lucid"})
+ c.Assert(bootstrap.SeriesToUpload(cfg, nil), jc.SameContents,
[]string{"quantal", "precise", "trusty", "lucid"})
  }

  func (s *bootstrapSuite) assertUploadTools(c *gc.C, vers version.Binary,
forceVersion bool,

Index: environs/bootstrap/synctools.go
=== modified file 'environs/bootstrap/synctools.go'
--- environs/bootstrap/synctools.go 2014-04-14 12:36:13 +0000
+++ environs/bootstrap/synctools.go 2014-04-24 04:01:26 +0000
@@ -92,6 +92,10 @@
   return vers
  }

+// Unless otherwise specified, we will upload tools for all lts series on
bootstrap
+// when --upload-tools is used.
+var toolsLtsSeries = []string{"precise", "trusty"}
+
  // SeriesToUpload returns the supplied series with duplicates removed if
  // non-empty; otherwise it returns a default list of series we should
  // probably upload, based on cfg.
@@ -99,7 +103,9 @@
   unique := set.NewStrings(series...)
   if unique.IsEmpty() {
    unique.Add(version.Current.Series)
- unique.Add(config.LatestLtsSeries())
+ for _, toolsSeries := range toolsLtsSeries {
+ unique.Add(toolsSeries)
+ }
    if series, ok := cfg.DefaultSeries(); ok {
     unique.Add(series)
    }

Revision history for this message
John A Meinel (jameinel) wrote :

LGTM, thanks for picking this up.

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (100.4 KiB)

The attempt to merge lp:~wallyworld/juju-core/bootstrap-supported-series into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.394s
ok launchpad.net/juju-core/agent/mongo 1.332s
ok launchpad.net/juju-core/agent/tools 0.188s
ok launchpad.net/juju-core/bzr 5.106s
ok launchpad.net/juju-core/cert 2.597s
ok launchpad.net/juju-core/charm 0.384s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.030s
ok launchpad.net/juju-core/cloudinit/sshinit 0.799s
ok launchpad.net/juju-core/cmd 0.134s
ok launchpad.net/juju-core/cmd/charm-admin 0.302s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/envcmd 0.148s

----------------------------------------------------------------------
FAIL: bootstrap_test.go:539: BootstrapSuite.TestAutoUploadAfterFailedSync

[LOG] 0:00.003 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 0:00.003 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 0:00.003 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson": stat /tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson: no such file or directory
[LOG] 0:00.003 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson": invalid URL "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.sjson" not found
[LOG] 0:00.003 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.json": stat /tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.json: no such file or directory
[LOG] 0:00.003 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.json": invalid URL "file:///tmp/jctest.s6O/gocheck-7504504064263669287/13/tools/streams/v1/index.json" not found
[LOG] 0:00.005 INFO juju.environs.tools Writing tools/streams/v1/index.json
[LOG] 0:00.006 INFO juju.environs.tools Writing tools/streams/v1/com.ubuntu.juju:released:tools.json
[LOG] 0:00.007 DEBUG juju.environs.tools no architecture specified when finding tools, looking for any
[LOG] 0:00.007 DEBUG juju.environs.tools no series specified when finding tools, looking for any
[LOG] 0:00.007 DEBUG juju.environs.simplestreams fetchData failed for "file:///tmp/jctest.s6O/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson": stat /tmp/jctest.s6O/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson: no such file or directory
[LOG] 0:00.007 DEBUG juju.environs.simplestreams cannot load index "file:///tmp/jctest.s6O/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson": invalid URL "file:///tmp/jctest.s6O/gocheck-7504504064263669287/14/tools/streams/v1/index.sjson" not foun...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/juju/bootstrap_test.go'
2--- cmd/juju/bootstrap_test.go 2014-04-24 02:27:38 +0000
3+++ cmd/juju/bootstrap_test.go 2014-04-24 05:19:31 +0000
4@@ -324,7 +324,8 @@
5 uploads: []string{
6 "1.2.3.1-saucy-amd64", // from version.Current
7 "1.2.3.1-raring-amd64", // from env.Config().DefaultSeries()
8- "1.2.3.1-%LTS%-amd64", // from environs/config.DefaultSeries
9+ "1.2.3.1-precise-amd64",
10+ "1.2.3.1-trusty-amd64",
11 },
12 }, {
13 info: "--upload-tools uses arch from constraint if it matches current version",
14@@ -334,7 +335,8 @@
15 uploads: []string{
16 "1.3.3.1-saucy-ppc64", // from version.Current
17 "1.3.3.1-raring-ppc64", // from env.Config().DefaultSeries()
18- "1.3.3.1-%LTS%-ppc64", // from environs/config.DefaultSeries
19+ "1.3.3.1-precise-ppc64",
20+ "1.3.3.1-trusty-ppc64",
21 },
22 constraints: constraints.MustParse("arch=ppc64"),
23 }, {
24@@ -343,7 +345,8 @@
25 args: []string{"--upload-tools"},
26 uploads: []string{
27 "1.2.3.1-raring-amd64",
28- "1.2.3.1-%LTS%-amd64",
29+ "1.2.3.1-precise-amd64",
30+ "1.2.3.1-trusty-amd64",
31 },
32 }, {
33 info: "--upload-tools rejects invalid series",
34@@ -368,7 +371,8 @@
35 args: []string{"--upload-tools"},
36 uploads: []string{
37 "1.2.3.5-raring-amd64",
38- "1.2.3.5-%LTS%-amd64",
39+ "1.2.3.5-precise-amd64",
40+ "1.2.3.5-trusty-amd64",
41 },
42 }, {
43 info: "placement",
44@@ -551,13 +555,14 @@
45 urls := list.URLs()
46
47 // We expect:
48- // latest LTS,
49+ // supported LTS series precise, trusty,
50 // the specified series (quantal),
51 // and the environment's default series (raring).
52 expectedVers := []version.Binary{
53 version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "quantal", version.Current.Arch)),
54 version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "raring", version.Current.Arch)),
55- version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", version.Current.Series, version.Current.Arch)),
56+ version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "precise", version.Current.Arch)),
57+ version.MustParseBinary(fmt.Sprintf("1.7.3.1-%s-%s", "trusty", version.Current.Arch)),
58 }
59 c.Assert(urls, gc.HasLen, len(expectedVers))
60 for _, vers := range expectedVers {
61
62=== modified file 'environs/bootstrap/bootstrap_test.go'
63--- environs/bootstrap/bootstrap_test.go 2014-04-24 02:27:38 +0000
64+++ environs/bootstrap/bootstrap_test.go 2014-04-24 05:19:31 +0000
65@@ -362,7 +362,7 @@
66 c.Assert(bootstrap.SeriesToUpload(cfg, []string{"quantal"}), jc.SameContents, []string{"quantal"})
67 env = newEnviron("foo", useDefaultKeys, map[string]interface{}{"default-series": "lucid"})
68 cfg = env.Config()
69- c.Assert(bootstrap.SeriesToUpload(cfg, nil), jc.SameContents, []string{"quantal", config.LatestLtsSeries(), "lucid"})
70+ c.Assert(bootstrap.SeriesToUpload(cfg, nil), jc.SameContents, []string{"quantal", "precise", "trusty", "lucid"})
71 }
72
73 func (s *bootstrapSuite) assertUploadTools(c *gc.C, vers version.Binary, forceVersion bool,
74
75=== modified file 'environs/bootstrap/synctools.go'
76--- environs/bootstrap/synctools.go 2014-04-14 12:36:13 +0000
77+++ environs/bootstrap/synctools.go 2014-04-24 05:19:31 +0000
78@@ -92,6 +92,10 @@
79 return vers
80 }
81
82+// Unless otherwise specified, we will upload tools for all lts series on bootstrap
83+// when --upload-tools is used.
84+var toolsLtsSeries = []string{"precise", "trusty"}
85+
86 // SeriesToUpload returns the supplied series with duplicates removed if
87 // non-empty; otherwise it returns a default list of series we should
88 // probably upload, based on cfg.
89@@ -99,7 +103,9 @@
90 unique := set.NewStrings(series...)
91 if unique.IsEmpty() {
92 unique.Add(version.Current.Series)
93- unique.Add(config.LatestLtsSeries())
94+ for _, toolsSeries := range toolsLtsSeries {
95+ unique.Add(toolsSeries)
96+ }
97 if series, ok := cfg.DefaultSeries(); ok {
98 unique.Add(series)
99 }

Subscribers

People subscribed via source and target branches

to status/vote changes: