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

Issue 6307071: environs: add the facility to query all running instances (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by dave
Modified:
13 years ago
Reviewers:
mp+109565, rog
Visibility:
Public.

Description

environs: add the facility to query all running instances The PA needs to be able to find out (with some degree of accuracy) all the instance id's known to the Environ. https://code.launchpad.net/~dave-cheney/juju-core/go-environs-get-all-instances/+merge/109565 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : environs: add the facility to query all running instances #

Total comments: 6

Patch Set 3 : environs: add the facility to query all running instances #

Total comments: 6

Patch Set 4 : environs: add the facility to query all running instances #

Patch Set 5 : environs: add the facility to query all running instances #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -0 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M environs/dummy/environs.go View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M environs/ec2/ec2.go View 1 2 3 1 chunk +17 lines, -0 lines 2 comments Download
M environs/interface.go View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M environs/jujutest/tests.go View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download

Messages

Total messages: 17
dave_cheney.net
Please take a look.
13 years ago (2012-06-11 05:56:30 UTC) #1
fwereade
Implementation looks good, but I see no tests.
13 years ago (2012-06-11 08:08:36 UTC) #2
rog
I'm not entirely sure about this. Also, it needs a test (in environs/jujutest). https://codereview.appspot.com/6307071/diff/2001/environs/interface.go File ...
13 years ago (2012-06-11 08:09:23 UTC) #3
dave_cheney.net
I'd prefer another method, AllInstances, to a boolean flag. I'll leave the decision up to ...
13 years ago (2012-06-11 08:15:45 UTC) #4
rog
On 11 June 2012 09:15, <dave@cheney.net> wrote: > I'd prefer another method, AllInstances, to a ...
13 years ago (2012-06-11 08:30:03 UTC) #5
niemeyer
I'm curious about why it needs such an AllInstances method. There are likely good reasons, ...
13 years ago (2012-06-11 18:27:32 UTC) #6
dave_cheney.net
In python the PA asks the provider for a list of running instances, then tries ...
13 years ago (2012-06-11 23:03:52 UTC) #7
dave_cheney.net
> I'm not entirely sure about this. > Also, it needs a test (in environs/jujutest). ...
13 years ago (2012-06-13 04:57:23 UTC) #8
rog
On 2012/06/13 04:57:23, dfc wrote: > So that is where they are. not yet, it ...
13 years ago (2012-06-13 08:26:53 UTC) #9
dave_cheney.net
Please take a look. https://codereview.appspot.com/6307071/diff/2001/environs/ec2/ec2.go File environs/ec2/ec2.go (right): https://codereview.appspot.com/6307071/diff/2001/environs/ec2/ec2.go#newcode372 environs/ec2/ec2.go:372: // fetchInstances queries ec2 for ...
13 years ago (2012-06-13 13:04:46 UTC) #10
niemeyer
On 2012/06/11 23:03:52, dfc wrote: > In python the PA asks the provider for a ...
13 years ago (2012-06-13 19:42:42 UTC) #11
niemeyer
LGTM. Leaving for rog to approve.
13 years ago (2012-06-13 19:47:33 UTC) #12
niemeyer
Sorry, this should be part of the comment above: https://codereview.appspot.com/6307071/diff/9002/environs/ec2/ec2.go File environs/ec2/ec2.go (left): https://codereview.appspot.com/6307071/diff/9002/environs/ec2/ec2.go#oldcode373 environs/ec2/ec2.go:373: ...
13 years ago (2012-06-13 19:47:58 UTC) #13
dave_cheney.net
Please take a look. https://codereview.appspot.com/6307071/diff/9002/environs/ec2/ec2.go File environs/ec2/ec2.go (left): https://codereview.appspot.com/6307071/diff/9002/environs/ec2/ec2.go#oldcode373 environs/ec2/ec2.go:373: if len(ids) == 0 { ...
13 years ago (2012-06-13 22:55:27 UTC) #14
niemeyer
I guess rog didn't see the note. This looks good and straightforward, though. Please feel ...
13 years ago (2012-06-15 01:14:02 UTC) #15
dave_cheney.net
*** Submitted: environs: add the facility to query all running instances The PA needs to ...
13 years ago (2012-06-15 01:31:16 UTC) #16
rog
13 years ago (2012-06-15 05:55:33 UTC) #17
LGTM. sorry for the delay.

https://codereview.appspot.com/6307071/diff/13002/environs/ec2/ec2.go
File environs/ec2/ec2.go (right):

https://codereview.appspot.com/6307071/diff/13002/environs/ec2/ec2.go#newcode330
environs/ec2/ec2.go:330: func (e *environ) gatherInstances(ids []string, insts
[]environs.Instance) error {
this method is associated with Instances. i think either AllInstances should
move before it, or it should move after Instances.

https://codereview.appspot.com/6307071/diff/13002/environs/ec2/ec2.go#newcode383
environs/ec2/ec2.go:383: insts = append(insts, &instance{e, &r.Instances[i]})
i think it's worth following gatherInstances here and making sure that every
instance doesn't keep all the other instances around:
inst := r.Instances[i]
insts = append(insts, &instance{e, &inst})
Sign in to reply to this message.

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