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

Issue 13348050: api(server)/uniter: Return tags instead of names (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by dimitern
Modified:
10 years, 8 months ago
Reviewers:
mp+183481, fwereade
Visibility:
Public.

Description

api(server)/uniter: Return tags instead of names UniterAPI.SubordinateNames() is renamed to HasSubordinates() and returns (bool, error). Added a TODO in uniter/modes.go to use it instead of calling len(u.unit.SubordinateNames) > 0, and since the other place SubordinateNames() was called is now handled by DestroyAllSubordinates() there's no need for it anymore. Also GetPrincipal() now returns a unit tag, not a name. https://code.launchpad.net/~dimitern/juju-core/114-api-uniter-names-to-tags/+merge/183481 Requires: https://code.launchpad.net/~dimitern/juju-core/113-api-uniter-unit-destroy-fix/+merge/183474 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : api(server)/uniter: Return tags instead of names #

Total comments: 4

Patch Set 3 : api(server)/uniter: Return tags instead of names #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -36 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/params/internal.go View 1 1 chunk +12 lines, -0 lines 0 comments Download
M state/api/uniter/unit.go View 1 1 chunk +7 lines, -10 lines 0 comments Download
M state/api/uniter/uniter_test.go View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M state/apiserver/uniter/uniter.go View 1 2 4 chunks +12 lines, -8 lines 0 comments Download
M state/apiserver/uniter/uniter_test.go View 1 2 chunks +25 lines, -13 lines 0 comments Download
M worker/uniter/modes.go View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5
dimitern
Please take a look.
10 years, 8 months ago (2013-09-02 14:54:21 UTC) #1
fwereade
suggestion as live https://codereview.appspot.com/13348050/diff/1/state/api/uniter/unit.go File state/api/uniter/unit.go (right): https://codereview.appspot.com/13348050/diff/1/state/api/uniter/unit.go#newcode251 state/api/uniter/unit.go:251: err := u.st.caller.Call("Uniter", "", "Subordinates", args, ...
10 years, 8 months ago (2013-09-02 15:30:54 UTC) #2
dimitern
Please take a look.
10 years, 8 months ago (2013-09-02 15:39:42 UTC) #3
fwereade
LGTM with trivials https://codereview.appspot.com/13348050/diff/5001/state/api/uniter/uniter_test.go File state/api/uniter/uniter_test.go (right): https://codereview.appspot.com/13348050/diff/5001/state/api/uniter/uniter_test.go#newcode268 state/api/uniter/uniter_test.go:268: ok, err := unit.HasSubordinates() found, err ...
10 years, 8 months ago (2013-09-02 15:42:59 UTC) #4
dimitern
10 years, 8 months ago (2013-09-02 15:57:49 UTC) #5
Please take a look.

https://codereview.appspot.com/13348050/diff/5001/state/api/uniter/uniter_tes...
File state/api/uniter/uniter_test.go (right):

https://codereview.appspot.com/13348050/diff/5001/state/api/uniter/uniter_tes...
state/api/uniter/uniter_test.go:268: ok, err := unit.HasSubordinates()
On 2013/09/02 15:42:59, fwereade wrote:
> found, err might read better. meh.

Done.

https://codereview.appspot.com/13348050/diff/5001/state/apiserver/uniter/unit...
File state/apiserver/uniter/uniter.go (right):

https://codereview.appspot.com/13348050/diff/5001/state/apiserver/uniter/unit...
state/apiserver/uniter/uniter.go:321: func (u *UniterAPI)
unitNamesToTags(unitNames []string) []string {
On 2013/09/02 15:42:59, fwereade wrote:
> still used?

No, removed, thanks.
Sign in to reply to this message.

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