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

Issue 21390045: Migrate get/set constraints cli to use api (Closed)

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

Description

Migrate get/set constraints cli to use api The juju get-constraints and set-constraints commands now use the api. https://code.launchpad.net/~wallyworld/juju-core/cli-api-constraints/+merge/193866 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -74 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/constraints.go View 3 chunks +10 lines, -21 lines 0 comments Download
M state/api/client.go View 1 chunk +17 lines, -2 lines 0 comments Download
M state/api/params/params.go View 1 chunk +5 lines, -5 lines 0 comments Download
M state/apiserver/client/client.go View 2 chunks +28 lines, -4 lines 4 comments Download
M state/apiserver/client/client_test.go View 1 chunk +58 lines, -0 lines 0 comments Download
M state/apiserver/client/perm_test.go View 2 chunks +13 lines, -0 lines 0 comments Download
D state/statecmd/getconstraints.go View 1 chunk +0 lines, -22 lines 0 comments Download
D state/statecmd/setconstraints.go View 1 chunk +0 lines, -20 lines 0 comments Download

Messages

Total messages: 3
wallyworld
Please take a look.
10 years, 5 months ago (2013-11-05 00:59:35 UTC) #1
axw
LGTM with a couple of quibbles https://codereview.appspot.com/21390045/diff/1/state/apiserver/client/client.go File state/apiserver/client/client.go (right): https://codereview.appspot.com/21390045/diff/1/state/apiserver/client/client.go#newcode316 state/apiserver/client/client.go:316: return params.GetConstraintsResults{constraints.Value{}}, err ...
10 years, 5 months ago (2013-11-05 01:37:30 UTC) #2
wallyworld
10 years, 5 months ago (2013-11-05 02:13:09 UTC) #3
https://codereview.appspot.com/21390045/diff/1/state/apiserver/client/client.go
File state/apiserver/client/client.go (right):

https://codereview.appspot.com/21390045/diff/1/state/apiserver/client/client....
state/apiserver/client/client.go:316: return
params.GetConstraintsResults{constraints.Value{}}, err
On 2013/11/05 01:37:30, axw wrote:
> Just params.GetConstraintsResults{} will do, and more obviously a zero value.

Fair point - this was cut and pasted from the deleted statecmd/setconstraints.go
file and I didn't pay too much attention to it cause it was already in the code
base :-)

https://codereview.appspot.com/21390045/diff/1/state/apiserver/client/client....
state/apiserver/client/client.go:326: return params.GetConstraintsResults{cons},
err
On 2013/11/05 01:37:30, axw wrote:
> Generally speaking, we should return zero values with err, shouldn't we? cons
> probably is anyway, but all the same. Otherwise you may as well elide the if
> statement and keep only the first return statement.

Done.
Sign in to reply to this message.

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