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

Issue 12105043: state: validate SetStatus inputs

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by fwereade
Modified:
10 years, 9 months ago
Reviewers:
mue, gz, mp+177616, rog
Visibility:
Public.

Description

state: validate SetStatus inputs https://code.launchpad.net/~fwereade/juju-core/state-validate-status/+merge/177616 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : state: validate SetStatus inputs #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -22 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/params/constants.go View 1 1 chunk +16 lines, -0 lines 1 comment Download
M state/machine.go View 1 1 chunk +3 lines, -6 lines 0 comments Download
M state/machine_test.go View 1 1 chunk +8 lines, -4 lines 0 comments Download
M state/status.go View 1 1 chunk +17 lines, -0 lines 0 comments Download
M state/unit.go View 1 1 chunk +3 lines, -3 lines 0 comments Download
M state/unit_test.go View 1 2 chunks +8 lines, -9 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
10 years, 9 months ago (2013-07-30 14:33:06 UTC) #1
mue
LGTM
10 years, 9 months ago (2013-07-30 16:28:41 UTC) #2
gz
LGTM
10 years, 9 months ago (2013-07-31 13:16:21 UTC) #3
rog
LGTM with a couple of trivial thoughts. https://codereview.appspot.com/12105043/diff/1/state/api/params/constants.go File state/api/params/constants.go (right): https://codereview.appspot.com/12105043/diff/1/state/api/params/constants.go#newcode57 state/api/params/constants.go:57: case StatusPending, ...
10 years, 9 months ago (2013-07-31 13:25:13 UTC) #4
fwereade
Please take a look. https://codereview.appspot.com/12105043/diff/1/state/api/params/constants.go File state/api/params/constants.go (right): https://codereview.appspot.com/12105043/diff/1/state/api/params/constants.go#newcode57 state/api/params/constants.go:57: case StatusPending, StatusInstalled, StatusStarted: On ...
10 years, 9 months ago (2013-07-31 14:23:47 UTC) #5
rog
10 years, 9 months ago (2013-07-31 15:26:16 UTC) #6
still LGTM

https://codereview.appspot.com/12105043/diff/1/state/status.go
File state/status.go (right):

https://codereview.appspot.com/12105043/diff/1/state/status.go#newcode28
state/status.go:28: return fmt.Errorf("cannot set invalid status %q",
doc.Status)
On 2013/07/31 14:23:47, fwereade wrote:
> On 2013/07/31 13:25:13, rog wrote:
> > 
> > Who's to say that statusDoc.validate is always to be called in a
"set-status"
> > context?
> > 
> > I'd just return "invalid status %q" (and below)
> 
> changed the name to validateSet to make it clear that it is. Then that
reminded
> me that StatusDown is also invalid for set, so I fixed that.

cool.

https://codereview.appspot.com/12105043/diff/9001/state/api/params/constants.go
File state/api/params/constants.go (right):

https://codereview.appspot.com/12105043/diff/9001/state/api/params/constants....
state/api/params/constants.go:64: default:
trivial i know, but if you return true above, you won't need a default clause.
Sign in to reply to this message.

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