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

Issue 7058061: cmd/juju: destroy-unit is more restrictive

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by fwereade
Modified:
11 years, 3 months ago
Reviewers:
dimitern, rog, mp+142478, TheMue
Visibility:
Public.

Description

cmd/juju: destroy-unit is more restrictive It now only accepts Alive (because allowing only a single destroy per entity is already conventional) principal (because subordinate lifecycle is controlled by the principal) units. https://code.launchpad.net/~fwereade/juju-core/destroy-unit-handle-subs/+merge/142478 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : cmd/juju: destroy-unit is more restrictive #

Total comments: 4

Patch Set 3 : cmd/juju: destroy-unit is more restrictive #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -42 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/cmd_test.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M cmd/juju/destroyunit.go View 1 2 chunks +4 lines, -12 lines 0 comments Download
M cmd/juju/destroyunit_test.go View 1 1 chunk +1 line, -7 lines 0 comments Download
M juju/conn.go View 1 2 1 chunk +18 lines, -1 line 0 comments Download
M juju/conn_test.go View 1 2 1 chunk +81 lines, -20 lines 0 comments Download

Messages

Total messages: 8
fwereade
Please take a look.
11 years, 3 months ago (2013-01-09 11:05:13 UTC) #1
TheMue
LGTM
11 years, 3 months ago (2013-01-09 11:18:08 UTC) #2
dimitern
LGTM
11 years, 3 months ago (2013-01-09 14:54:02 UTC) #3
rog
the behaviour seems good, but one thought below. https://codereview.appspot.com/7058061/diff/1/cmd/juju/destroyunit.go File cmd/juju/destroyunit.go (right): https://codereview.appspot.com/7058061/diff/1/cmd/juju/destroyunit.go#newcode52 cmd/juju/destroyunit.go:52: if ...
11 years, 3 months ago (2013-01-09 14:59:23 UTC) #4
fwereade
Thanks guys; rog, I think you're right. Assuming a clean and simple move of the ...
11 years, 3 months ago (2013-01-09 15:02:30 UTC) #5
fwereade
Please take a look.
11 years, 3 months ago (2013-01-10 10:50:06 UTC) #6
rog
LGTM with a couple of trivial suggestions. https://codereview.appspot.com/7058061/diff/6001/juju/conn.go File juju/conn.go (right): https://codereview.appspot.com/7058061/diff/6001/juju/conn.go#newcode264 juju/conn.go:264: if unit, ...
11 years, 3 months ago (2013-01-10 10:56:05 UTC) #7
fwereade
11 years, 3 months ago (2013-01-10 16:06:48 UTC) #8
*** Submitted:

cmd/juju: destroy-unit is more restrictive

It now only accepts Alive (because allowing only a single destroy per entity
is already conventional) principal (because subordinate lifecycle is
controlled by the principal) units.

R=TheMue, dimitern, rog
CC=
https://codereview.appspot.com/7058061

https://codereview.appspot.com/7058061/diff/6001/juju/conn.go
File juju/conn.go (right):

https://codereview.appspot.com/7058061/diff/6001/juju/conn.go#newcode264
juju/conn.go:264: if unit, err := conn.State.Unit(name); state.IsNotFound(err) {
On 2013/01/10 10:56:05, rog wrote:
> this may well look better with a switch.
> 
> unit, err := conn.State.Unit(name)
> switch {
> case state.IsNotFound(err):
>       return fmt.Errorf("unit %q is not alive", name)
> case err != nil:
>    etc
> }

Done.

https://codereview.appspot.com/7058061/diff/6001/juju/conn_test.go
File juju/conn_test.go (right):

https://codereview.appspot.com/7058061/diff/6001/juju/conn_test.go#newcode512
juju/conn_test.go:512: }
On 2013/01/10 10:56:05, rog wrote:
> add newline

Done.
Sign in to reply to this message.

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