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

Issue 92390050: Add output for ensure-availability command. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by domas
Modified:
9 years, 11 months ago
Reviewers:
mp+220306, axw, fwereade, mattyw
Visibility:
Public.

Description

Add output for ensure-availability command. The ensure-availability command will notify the user, how many state servers were added to the environment. $ juju ensure-availability -n 7 Added 6 state servers. https://code.launchpad.net/~tasdomas/juju-core/ensure-availability-more-output/+merge/220306 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add output for ensure-availability command. #

Total comments: 1

Patch Set 3 : Add output for ensure-availability command. #

Patch Set 4 : Add output for ensure-availability command. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -70 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/ensureavailability.go View 1 2 3 2 chunks +44 lines, -2 lines 2 comments Download
M cmd/juju/ensureavailability_test.go View 1 2 3 7 chunks +50 lines, -14 lines 0 comments Download
M state/addmachine.go View 5 chunks +29 lines, -11 lines 2 comments Download
M state/api/client.go View 1 chunk +8 lines, -2 lines 0 comments Download
M state/api/params/params.go View 1 chunk +7 lines, -0 lines 0 comments Download
M state/apiserver/client/client.go View 2 chunks +9 lines, -5 lines 0 comments Download
M state/apiserver/client/client_test.go View 6 chunks +25 lines, -10 lines 0 comments Download
M state/apiserver/provisioner/provisioner_test.go View 1 chunk +5 lines, -1 line 0 comments Download
M state/assign_test.go View 1 chunk +2 lines, -1 line 0 comments Download
M state/state_test.go View 17 chunks +76 lines, -24 lines 0 comments Download

Messages

Total messages: 11
domas
Please take a look.
9 years, 11 months ago (2014-05-20 16:28:43 UTC) #1
mattyw
https://codereview.appspot.com/92390050/diff/1/cmd/juju/ensureavailability.go File cmd/juju/ensureavailability.go (right): https://codereview.appspot.com/92390050/diff/1/cmd/juju/ensureavailability.go#newcode83 cmd/juju/ensureavailability.go:83: ctx.Infof("Added %d state servers.", availabilityResult.NewCount) Maybe we should add ...
9 years, 11 months ago (2014-05-20 16:32:23 UTC) #2
domas
Please take a look.
9 years, 11 months ago (2014-05-20 16:51:48 UTC) #3
axw
https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go File cmd/juju/ensureavailability.go (right): https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go#newcode83 cmd/juju/ensureavailability.go:83: ctx.Infof("Added %d state servers.", availabilityResult.NewCount) Plural form is wrong ...
9 years, 11 months ago (2014-05-21 01:46:54 UTC) #4
domas
On 2014/05/21 01:46:54, axw wrote: > https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go > File cmd/juju/ensureavailability.go (right): > > https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go#newcode83 > ...
9 years, 11 months ago (2014-05-21 07:35:06 UTC) #5
domas
Please take a look.
9 years, 11 months ago (2014-05-21 07:42:52 UTC) #6
axw
On 2014/05/21 07:35:06, domas wrote: > On 2014/05/21 01:46:54, axw wrote: > > > https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go ...
9 years, 11 months ago (2014-05-21 07:44:44 UTC) #7
fwereade
On 2014/05/21 07:35:06, domas wrote: > On 2014/05/21 01:46:54, axw wrote: > > > https://codereview.appspot.com/92390050/diff/20001/cmd/juju/ensureavailability.go ...
9 years, 11 months ago (2014-05-21 07:45:09 UTC) #8
domas
Please take a look.
9 years, 11 months ago (2014-05-21 17:25:07 UTC) #9
domas
On 2014/05/21 07:45:09, fwereade wrote: > On 2014/05/21 07:35:06, domas wrote: > > On 2014/05/21 ...
9 years, 11 months ago (2014-05-21 17:27:10 UTC) #10
fwereade
9 years, 11 months ago (2014-05-26 13:27:34 UTC) #11
Couple more comments. I should chat to nate.

https://codereview.appspot.com/92390050/diff/60001/cmd/juju/ensureavailabilit...
File cmd/juju/ensureavailability.go (right):

https://codereview.appspot.com/92390050/diff/60001/cmd/juju/ensureavailabilit...
cmd/juju/ensureavailability.go:85: ctx.Infof("Added %d state server.",
availabilityResult.NewCount)
We've generally been consistent about lower-case in messages.

https://codereview.appspot.com/92390050/diff/60001/cmd/juju/ensureavailabilit...
cmd/juju/ensureavailability.go:115: result += fmt.Sprintf("\"%s\"", machine.Tag)
Tags are for the API, not for the UI. There should be a func in the names
package for getting ids back from tags.

https://codereview.appspot.com/92390050/diff/60001/state/addmachine.go
File state/addmachine.go (right):

https://codereview.appspot.com/92390050/diff/60001/state/addmachine.go#newcod...
state/addmachine.go:504: func (st *State) EnsureAvailability(numStateServers
int, cons constraints.Value, series string) (params.EnsureAvailabilityResult,
error) {
I'm not very keen on this (although I see someone recently did it with
params.StateServingInfo -- Nate, shouldn't that be fixed as well?). It makes it
way to easy to change the API by "just" adding/removing a field that's used by
the state package.

And this is talking in terms of tags, anyway. While there's been some leakage of
the tag vocabulary into state, it's not really a good thing, and only used when
there's some uncertainty about the kind of entity we're dealing with. Please
either use a result struct appropriate to the problem (*including* the new
machines created) or, I think better, leave this method alone and just figure
out what changed in the course of the call by diffing two
what-are-the-state-servers calls.

https://codereview.appspot.com/92390050/diff/60001/state/addmachine.go#newcod...
state/addmachine.go:637: }
This doesn't tell us which machines are the added state servers, which is IMO
the main thing people want to know when they call ensure-availability.
Sign in to reply to this message.

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