Merge lp:~jameinel/juju-core/1.18-local-trusty-and-precise-1306537 into lp:juju-core/1.18

Proposed by John A Meinel
Status: Rejected
Rejected by: John A Meinel
Proposed branch: lp:~jameinel/juju-core/1.18-local-trusty-and-precise-1306537
Merge into: lp:juju-core/1.18
Diff against target: 17 lines (+7/-0)
1 file modified
cmd/juju/bootstrap.go (+7/-0)
To merge this branch: bzr merge lp:~jameinel/juju-core/1.18-local-trusty-and-precise-1306537
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+216888@code.launchpad.net

Description of the change

bootstrap: always provider precise and trusty

Now that we have 2 potential LTS targets, when we bootstrap the local
provider, make sure we upload tools for both of them. That way when
deploying charms, we can successfully deploy all the stable charms.

This addresses bug #1306537, perhaps as a band-aid but I think a
reasonable one.

https://codereview.appspot.com/90640043/

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

Note, there aren't any tests for this because I couldn't find any tests for the local provider behavior of forcing --upload-tools. So I punted.

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

Reviewers: mp+216888_code.launchpad.net,

Message:
Please take a look.

Description:
bootstrap: always provider precise and trusty

Now that we have 2 potential LTS targets, when we bootstrap the local
provider, make sure we upload tools for both of them. That way when
deploying charms, we can successfully deploy all the stable charms.

This addresses bug #1306537, perhaps as a band-aid but I think a
reasonable one.

https://code.launchpad.net/~jameinel/juju-core/1.18-local-trusty-and-precise-1306537/+merge/216888

(do not edit description out of merge proposal)

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

Affected files (+9, -0 lines):
   A [revision details]
   M cmd/juju/bootstrap.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-20140412095413-8rps4bhva01cu0o9
+New revision: <email address hidden>

Index: cmd/juju/bootstrap.go
=== modified file 'cmd/juju/bootstrap.go'
--- cmd/juju/bootstrap.go 2014-03-26 03:30:35 +0000
+++ cmd/juju/bootstrap.go 2014-04-23 13:47:11 +0000
@@ -133,6 +133,13 @@
   // unnecessary upload.
   if environ.Config().Type() == provider.Local {
    c.UploadTools = true
+ if len(c.Series) == 0 {
+ // If we are going to be forcing the tools, we might as
+ // well give all the LTS targets.
+ // Otherwise when provisioning Precise, we'll fail to
+ // start up: bug #1306537
+ c.Series = []string{"precise", "trusty"}
+ }
   }
   if c.UploadTools {
    err = bootstrap.UploadTools(ctx, environ, c.Constraints.Arch, true,
c.Series...)

Revision history for this message
Andrew Wilkins (axwalk) wrote :

One comment, otherwise LGTM.

https://codereview.appspot.com/90640043/diff/1/cmd/juju/bootstrap.go
File cmd/juju/bootstrap.go (right):

https://codereview.appspot.com/90640043/diff/1/cmd/juju/bootstrap.go#newcode137
cmd/juju/bootstrap.go:137: // If we are going to be forcing the tools,
we might as
Should this be under "if c.UploadTools" below, rather than specific to
the local provider?

https://codereview.appspot.com/90640043/

Revision history for this message
Ian Booth (wallyworld) wrote :

not lgtm since as per my comments i think the correct place to make this
change is elsewhere.

https://codereview.appspot.com/90640043/diff/1/cmd/juju/bootstrap.go
File cmd/juju/bootstrap.go (right):

https://codereview.appspot.com/90640043/diff/1/cmd/juju/bootstrap.go#newcode142
cmd/juju/bootstrap.go:142: }
Actually, this is the wrong place to put this change.
The correct place to make this change is bootstrap.SeriesToUpload() in
environs/bootstrap/synctools.go

This method adds in series from:
- version.Current.Series
- config.LatestLtsSeries()
- cfg.DefaultSeries()

But when LatestLtsSeries() switched to trusty, it broke things on trusty
hosts.
I think the correct change is to simply replace config.LatestLtsSeries()
with "precise, trusty". And, as a bonus, there are tests for that.

https://codereview.appspot.com/90640043/

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

We're going with SeriesToUpload which Ian already has a patch for.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/juju/bootstrap.go'
2--- cmd/juju/bootstrap.go 2014-03-26 03:30:35 +0000
3+++ cmd/juju/bootstrap.go 2014-04-23 13:50:41 +0000
4@@ -133,6 +133,13 @@
5 // unnecessary upload.
6 if environ.Config().Type() == provider.Local {
7 c.UploadTools = true
8+ if len(c.Series) == 0 {
9+ // If we are going to be forcing the tools, we might as
10+ // well give all the LTS targets.
11+ // Otherwise when provisioning Precise, we'll fail to
12+ // start up: bug #1306537
13+ c.Series = []string{"precise", "trusty"}
14+ }
15 }
16 if c.UploadTools {
17 err = bootstrap.UploadTools(ctx, environ, c.Constraints.Arch, true, c.Series...)

Subscribers

People subscribed via source and target branches

to all changes: