Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10352)

Issue 13081044: Extract common bootstrap code / tools search (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by wallyworld
Modified:
10 years, 8 months ago
Reviewers:
jameinel, fwereade, mp+181491
Visibility:
Public.

Description

Extract common bootstrap code / tools search This branch reduces the multiple call points for FindBootstrapTools and FindInstanceTools. In so doing, bug 1199847 was addressed - common code was extracted for starting instances and bootstrapping environs. This means that we no longer have gobfuls of code duplication in each provider and I can now easily replace the current tools finding logic with simplestreams stuff. https://code.launchpad.net/~wallyworld/juju-core/simplify-tools-search/+merge/181491 Requires: https://code.launchpad.net/~wallyworld/juju-core/refactor-tools-packaging/+merge/181186 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+427 lines, -580 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap.go View 2 chunks +2 lines, -1 line 0 comments Download
M cmd/jujud/bootstrap.go View 3 chunks +3 lines, -2 lines 0 comments Download
M environs/bootstrap/bootstrap.go View 4 chunks +25 lines, -13 lines 2 comments Download
M environs/bootstrap/bootstrap_test.go View 6 chunks +10 lines, -8 lines 0 comments Download
M environs/broker.go View 1 chunk +9 lines, -7 lines 1 comment Download
M environs/cloudinit.go View 1 chunk +2 lines, -2 lines 0 comments Download
M environs/interface.go View 6 chunks +8 lines, -17 lines 1 comment Download
M environs/jujutest/livetests.go View 6 chunks +11 lines, -5 lines 0 comments Download
M environs/jujutest/tests.go View 3 chunks +6 lines, -5 lines 0 comments Download
M environs/open_test.go View 2 chunks +5 lines, -3 lines 0 comments Download
M environs/polling.go View 1 chunk +7 lines, -0 lines 0 comments Download
M environs/tools/export_test.go View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/tools/storage_test.go View 1 chunk +1 line, -1 line 0 comments Download
M environs/tools/tools.go View 2 chunks +12 lines, -3 lines 0 comments Download
M juju/apiconn_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M juju/conn_test.go View 7 chunks +7 lines, -6 lines 0 comments Download
M juju/testing/conn.go View 3 chunks +5 lines, -2 lines 0 comments Download
M provider/azure/environ.go View 15 chunks +28 lines, -104 lines 0 comments Download
M provider/dummy/environs.go View 7 chunks +21 lines, -26 lines 0 comments Download
M provider/ec2/ec2.go View 6 chunks +18 lines, -77 lines 0 comments Download
M provider/ec2/live_test.go View 2 chunks +2 lines, -1 line 0 comments Download
M provider/ec2/local_test.go View 8 chunks +10 lines, -8 lines 0 comments Download
A provider/instance.go View 1 chunk +81 lines, -0 lines 5 comments Download
M provider/local/environ.go View 12 chunks +36 lines, -50 lines 0 comments Download
M provider/maas/environ.go View 5 chunks +26 lines, -104 lines 0 comments Download
M provider/maas/environ_test.go View 9 chunks +13 lines, -11 lines 0 comments Download
M provider/openstack/local_test.go View 6 chunks +7 lines, -5 lines 0 comments Download
M provider/openstack/provider.go View 5 chunks +18 lines, -81 lines 0 comments Download
M tools/list.go View 2 chunks +12 lines, -2 lines 0 comments Download
M tools/list_test.go View 1 chunk +1 line, -1 line 2 comments Download
M tools/tools.go View 1 chunk +6 lines, -0 lines 1 comment Download
D worker/provisioner/environ_broker.go View 1 chunk +0 lines, -21 lines 0 comments Download
M worker/provisioner/lxc-broker.go View 3 chunks +18 lines, -6 lines 1 comment Download
M worker/provisioner/lxc-broker_test.go View 3 chunks +4 lines, -2 lines 0 comments Download
M worker/provisioner/provisioner.go View 1 chunk +2 lines, -2 lines 0 comments Download
M worker/provisioner/provisioner_task.go View 4 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 3
wallyworld
Please take a look.
10 years, 8 months ago (2013-08-22 08:48:31 UTC) #1
jameinel
I really like to see the code getting shared. And a lot of this patch ...
10 years, 8 months ago (2013-08-22 09:59:42 UTC) #2
fwereade
10 years, 8 months ago (2013-08-22 11:05:46 UTC) #3
Thanks, this is great. LGTM; trivials only.

Please make sure it still works live, though ;).

https://codereview.appspot.com/13081044/diff/1/environs/bootstrap/bootstrap.go
File environs/bootstrap/bootstrap.go (right):

https://codereview.appspot.com/13081044/diff/1/environs/bootstrap/bootstrap.g...
environs/bootstrap/bootstrap.go:59: log.Infof("bootstrapping environment %q",
environ.Name())
On 2013/08/22 09:59:42, jameinel wrote:
> you added a logger, I would imagine you want to call:
> logger.Infof
> rather than
> log.Infof
> 
> I'm a bit surprised that you import "juju-core/log" at all in this file, as I
> thought we were getting away from that package.

+1

https://codereview.appspot.com/13081044/diff/1/environs/broker.go
File environs/broker.go (right):

https://codereview.appspot.com/13081044/diff/1/environs/broker.go#newcode22
environs/broker.go:22: machineConfig *cloudinit.MachineConfig,
heh, is there a cycle around the cloudinit package? if so, given that we hope to
move it at some stage, it'd be nice to have a "TODO move Broker to instance
package"

https://codereview.appspot.com/13081044/diff/1/environs/interface.go
File environs/interface.go (right):

https://codereview.appspot.com/13081044/diff/1/environs/interface.go#newcode199
environs/interface.go:199: type List tools.List
slight raised eyebrow here

https://codereview.appspot.com/13081044/diff/1/provider/instance.go
File provider/instance.go (right):

https://codereview.appspot.com/13081044/diff/1/provider/instance.go#newcode17
provider/instance.go:17: coretools "launchpad.net/juju-core/tools"
On 2013/08/22 09:59:42, jameinel wrote:
> Of envtools vs coretools, I would probably have picked 'coretools' as the one
> that would just be 'tools'. Though my experience with the "testing" packages
is
> that we should just rename both of them.
> 
> So "
> 
> envtools "launchpad.net/juju-core/environs/tools"
> coretools "launchpad.net/juju-core/tools"
> 
> That way you never get confused in the code itself which one it is this time.

+1 also. I'd like it most if that were consolidated in its own CL though.

https://codereview.appspot.com/13081044/diff/1/provider/instance.go#newcode73
provider/instance.go:73: if err2 != nil {
I do kinda prefer reusing err in its own tighter scope, but mileage reasonably
varies I guess :).

https://codereview.appspot.com/13081044/diff/1/tools/list_test.go
File tools/list_test.go (left):

https://codereview.appspot.com/13081044/diff/1/tools/list_test.go#oldcode76
tools/list_test.go:76: }
On 2013/08/22 09:59:42, jameinel wrote:
> Shouldn't the test name be changed to "TestAllSeries", and aren't we missing a
> TestOneSeries test?

+1

https://codereview.appspot.com/13081044/diff/1/tools/tools.go
File tools/tools.go (right):

https://codereview.appspot.com/13081044/diff/1/tools/tools.go#newcode21
tools/tools.go:21: type HasTools interface {
slight raised eyebrow, but I guess there's also something nice about
`foo.(HasTools)`... let's run with it and see if it turns out to be a pain.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b