environ.Instances and .AllInstances implemented for MAAS 2 #4995

Merged
merged 27 commits into from Apr 6, 2016

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Apr 5, 2016

Rather than branching in AllInstances, push the API version branching down into acquiredInstances.

Corrected some error handling in Instances - before it wouldn't return ErrPartialInstances if the set of ids that came back was different but had the same size.

Michael Foord and others added some commits Apr 1, 2016

Removed faking out of environ.instances
It can be implemented properly now that machine filtering is in
gomaasapi.
Removed scaffolded refresh method
Will add back in when implementing it properly.
Remove tests for legacy addresses
These were rendered obsolete by the changes in 84c8ed6.
Rename instances to instances1, implement instances2
Removed allInstances2, added the branch in acquiredInstances.
More tests for AllInstances
Also fixed error handling in AllInstances - before it wouldn't have
returned ErrPartialInstances if the same number of machines came back,
even if the ids didn't match up.
provider/maas/environ.go
+ } else {
+ filter := getSystemIdValues("id", ids)
+ filter.Add("agent_name", environ.ecfg().maasAgentName())
+ return environ.instances1(filter)
@natefinch

natefinch Apr 5, 2016

Contributor

I'd put the maas1 up top, since it's shorter, and then drop the else and unindent, since you're returning in the first block.

Contributor

natefinch commented Apr 5, 2016

other than one nitpick, LGTM

Member

babbageclunk commented Apr 6, 2016

$$merge$$

Contributor

jujubot commented Apr 6, 2016

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

@jujubot jujubot merged commit 26ac1eb into juju:maas2 Apr 6, 2016

@babbageclunk babbageclunk deleted the babbageclunk:maas2-acquired-instances branch Apr 25, 2016

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