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

Issue 97400043: Change StopInstances to take []instance.Id

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 9 months ago by axw
Modified:
5 years, 9 months ago
Reviewers:
mp+219347, dfc, wallyworld
Visibility:
Public.

Description

Change StopInstances to take []instance.Id StopInstances previously took []instance.Instance, which is unnecessary for most providers, and imposes an unnecessary cost for callers that only have IDs initially. We change StopInstances to The openstack provider's StopInstances is now slightly more expensive than before, requiring an additional call to Instances. This cost will disappear when we fix the security groups/open-port implementation. Drive-by: the maas provider now uses a bulk "release" in StopInstances. Live tested on ec2, local, virtual MAAS, canonistack, azure. I lack a Joyent account, but I think it should be fine. Fixes lp:1260171 Fixes lp:1316272 https://code.launchpad.net/~axwalk/juju-core/lp1260171-stopinstances-ids/+merge/219347 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : Change StopInstances to take []instance.Id #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -257 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M container/interface.go View 1 1 chunk +7 lines, -3 lines 0 comments Download
M container/kvm/kvm.go View 1 chunk +2 lines, -2 lines 0 comments Download
M container/kvm/kvm_test.go View 1 chunk +1 line, -1 line 0 comments Download
M container/kvm/live_test.go View 1 chunk +1 line, -1 line 0 comments Download
M container/lxc/lxc.go View 1 chunk +2 lines, -2 lines 0 comments Download
M container/lxc/lxc_test.go View 5 chunks +5 lines, -5 lines 0 comments Download
M dependencies.tsv View 1 chunk +1 line, -1 line 0 comments Download
M environs/broker.go View 1 1 chunk +3 lines, -2 lines 0 comments Download
M environs/jujutest/livetests.go View 1 6 chunks +6 lines, -6 lines 0 comments Download
M environs/jujutest/tests.go View 1 1 chunk +1 line, -1 line 0 comments Download
M provider/azure/environ.go View 1 4 chunks +17 lines, -16 lines 0 comments Download
M provider/azure/environ_test.go View 1 7 chunks +11 lines, -12 lines 0 comments Download
M provider/common/bootstrap.go View 1 1 chunk +1 line, -1 line 0 comments Download
M provider/common/bootstrap_test.go View 4 chunks +7 lines, -7 lines 0 comments Download
M provider/common/destroy.go View 1 2 chunks +6 lines, -1 line 0 comments Download
M provider/common/destroy_test.go View 3 chunks +11 lines, -11 lines 0 comments Download
M provider/common/mock_test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M provider/dummy/environs.go View 1 3 chunks +7 lines, -7 lines 0 comments Download
M provider/ec2/ec2.go View 1 1 chunk +1 line, -5 lines 0 comments Download
M provider/ec2/live_test.go View 1 4 chunks +5 lines, -5 lines 0 comments Download
M provider/joyent/environ_instance.go View 1 2 chunks +39 lines, -6 lines 0 comments Download
M provider/joyent/instance.go View 2 chunks +0 lines, -41 lines 0 comments Download
M provider/joyent/local_test.go View 1 3 chunks +3 lines, -3 lines 0 comments Download
M provider/local/environ.go View 1 2 chunks +5 lines, -5 lines 0 comments Download
M provider/maas/environ.go View 1 3 chunks +11 lines, -25 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 1 3 chunks +17 lines, -13 lines 0 comments Download
M provider/maas/util.go View 1 chunk +3 lines, -3 lines 0 comments Download
M provider/maas/util_test.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/manual/environ.go View 1 1 chunk +1 line, -1 line 0 comments Download
M provider/openstack/local_test.go View 1 8 chunks +8 lines, -8 lines 0 comments Download
M provider/openstack/provider.go View 1 2 chunks +23 lines, -19 lines 0 comments Download
M state/apiserver/client/destroy.go View 1 1 chunk +1 line, -22 lines 0 comments Download
M worker/provisioner/kvm-broker.go View 1 1 chunk +4 lines, -4 lines 0 comments Download
M worker/provisioner/kvm-broker_test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M worker/provisioner/lxc-broker.go View 1 1 chunk +4 lines, -4 lines 0 comments Download
M worker/provisioner/lxc-broker_test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M worker/provisioner/provisioner_task.go View 1 2 chunks +6 lines, -2 lines 0 comments Download
M worker/provisioner/provisioner_test.go View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6
axw
Please take a look.
5 years, 9 months ago (2014-05-13 11:58:10 UTC) #1
dfc
On 2014/05/13 11:58:10, axw wrote: > Please take a look. SGTM. How do you feel ...
5 years, 9 months ago (2014-05-13 21:36:31 UTC) #2
wallyworld
LGTM, agree with Dave's comment so would be good to do that before landing https://codereview.appspot.com/97400043/diff/1/container/interface.go ...
5 years, 9 months ago (2014-05-14 02:37:16 UTC) #3
axw
On 2014/05/13 21:36:31, dfc wrote: > On 2014/05/13 11:58:10, axw wrote: > > Please take ...
5 years, 9 months ago (2014-05-14 02:48:47 UTC) #4
axw
Please take a look. https://codereview.appspot.com/97400043/diff/1/container/interface.go File container/interface.go (right): https://codereview.appspot.com/97400043/diff/1/container/interface.go#newcode31 container/interface.go:31: // Instance. On 2014/05/14 02:37:16, ...
5 years, 9 months ago (2014-05-14 03:05:04 UTC) #5
dfc
5 years, 9 months ago (2014-05-14 03:31:12 UTC) #6
On Wed, May 14, 2014 at 12:37 PM,  <ian.booth@canonical.com> wrote:
> LGTM, agree with Dave's comment so would be good to do that before
> landing

Making StopInstance variadic would make some callers initially more verbose, ie

var i []instance.Instance
p.StopInstances(i...) // note variadic expansion to pass the contents
of the slice, not the slice itself.

but, as I found with the change that I made to Addresses recently,
most of the callers that are creating those slices are doing so to
pass one item, so they can be refactored to be variadic themselves and
everything becomes a lot simpler to read without so much tedious
boxing of single values into slices.
Sign in to reply to this message.

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