Remove environs/tools.FindInstanceTools #649

Merged
merged 1 commit into from Sep 2, 2014

Conversation

Projects
None yet
4 participants
Member

axw commented Sep 1, 2014

Reduce surface area of environs/tools as we reduce reliance on it. Eventually the simplestreams parts should be relocated and become client-side, import-only. Several users do not need to be using FindInstanceTools (use FindExactTools or just FindTools instead).

Contributor

mjs commented Sep 1, 2014

This PR needs a description...

juju/testing/instance.go
+ if params.Constraints.Arch != nil {
+ filter.Arch = *params.Constraints.Arch
+ }
+ possibleTools, err := tools.FindTools(env, -1, -1, filter, false)
@mjs

mjs Sep 1, 2014

Contributor

This is probably outside the scope of this PR but I wish the -1's and false where defined as consts (in tools or coretools) with self documenting names.

@mjs

mjs Sep 1, 2014

Contributor

I've just noticed there is a DoNotAllowRetry in environs/tools which is intended for the last parameter.

@axw

axw Sep 2, 2014

Member

Thanks for the reminder, used DoNotAllowRetry. Leaving the -1's alone for now, but agree they could do with some description. The AllowRetry/DoNotAllowRetry constants (and the parameter) will be going away.

state/apiserver/client/machineconfig.go
- tools, err := findInstanceTools(env, machine.Series(), *hc.Arch)
+ agentVersion, ok := env.Config().AgentVersion()
+ if !ok {
+ return nil, fmt.Errorf("no agent version set in environment configuration")
@mjs

mjs Sep 1, 2014

Contributor

errors.New()

@axw

axw Sep 2, 2014

Member

Done.

worker/provisioner/provisioner_test.go
+ expectedList, err := tools.FindTools(s.Environ, -1, -1, coretools.Filter{
+ Number: currentVersion.Number,
+ Series: currentVersion.Series,
+ }, false)
@mjs

mjs Sep 1, 2014

Contributor

as above

@axw

axw Sep 2, 2014

Member

Done.

Contributor

mjs commented Sep 1, 2014

LGTM with only minor comments. My review mentor @howbazaar needs to do a meta-review however.

Owner

howbazaar commented Sep 1, 2014

Review by @mjs looks good to me.

Member

axw commented Sep 2, 2014

$$merge$$

Contributor

jujubot commented Sep 2, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Sep 2, 2014

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/502

Member

axw commented Sep 2, 2014

$$tryagain$$

Contributor

jujubot commented Sep 2, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Sep 2, 2014

Merge pull request #649 from axw/remove-environs-tools-findinstancetools
Remove environs/tools.FindInstanceTools

Reduce surface area of environs/tools as we reduce reliance on it. Eventually the simplestreams parts should be relocated and become client-side, import-only. Several users do not need to be using FindInstanceTools (use FindExactTools or just FindTools instead).

@jujubot jujubot merged commit 495bf02 into juju:master Sep 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment