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

Issue 7063055: state: change unit *Address methods

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

Description

state: change unit *Address methods ...to return (string, bool) instead of (string, error), as discussed and agreed to be a good idea some time ago; did the same to appropriate jujuc.Context methods. https://code.launchpad.net/~fwereade/juju-core/unit-address-methods/+merge/142548 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : state: change unit *Address methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -73 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/builddb/main.go View 2 chunks +4 lines, -3 lines 0 comments Download
M cmd/juju/ssh.go View 1 chunk +5 lines, -1 line 0 comments Download
M cmd/juju/status.go View 1 chunk +1 line, -1 line 0 comments Download
M state/relation.go View 1 chunk +3 lines, -3 lines 0 comments Download
M state/relation_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/unit.go View 1 1 chunk +6 lines, -12 lines 0 comments Download
M state/unit_test.go View 5 chunks +26 lines, -26 lines 0 comments Download
M worker/uniter/context.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M worker/uniter/context_test.go View 1 2 chunks +8 lines, -8 lines 0 comments Download
M worker/uniter/jujuc/context.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M worker/uniter/jujuc/unit-get.go View 1 1 chunk +6 lines, -6 lines 0 comments Download
M worker/uniter/jujuc/util_test.go View 1 1 chunk +4 lines, -4 lines 0 comments Download
M worker/uniter/uniter_test.go View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
11 years, 4 months ago (2013-01-09 16:20:09 UTC) #1
TheMue
Don't know the reason anymore, so would like a little summary here. But the code ...
11 years, 4 months ago (2013-01-09 16:23:41 UTC) #2
rog
LGTM assuming HookContext.*Address fixed in the same way, and with a suggestion for some simplification. ...
11 years, 4 months ago (2013-01-09 16:24:47 UTC) #3
fwereade
On 2013/01/09 16:23:41, TheMue wrote: > Don't know the reason anymore, so would like a ...
11 years, 4 months ago (2013-01-09 16:32:13 UTC) #4
fwereade
11 years, 4 months ago (2013-01-09 16:58:31 UTC) #5
*** Submitted:

state: change unit *Address methods

...to return (string, bool) instead of (string, error), as discussed and
agreed to be a good idea some time ago; did the same to appropriate
jujuc.Context methods.

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

https://codereview.appspot.com/7063055/diff/1/state/unit.go
File state/unit.go (right):

https://codereview.appspot.com/7063055/diff/1/state/unit.go#newcode244
state/unit.go:244: if u.doc.PublicAddress == "" {
On 2013/01/09 16:24:47, rog wrote:
> return u.doc.PublicAddress, u.doc.PublicAddress != ""
> ?

Done.

https://codereview.appspot.com/7063055/diff/1/state/unit.go#newcode252
state/unit.go:252: if u.doc.PrivateAddress == "" {
On 2013/01/09 16:24:47, rog wrote:
> as above

Done.

https://codereview.appspot.com/7063055/diff/1/worker/uniter/context.go
File worker/uniter/context.go (right):

https://codereview.appspot.com/7063055/diff/1/worker/uniter/context.go#newcode59
worker/uniter/context.go:59: func (ctx *HookContext) PublicAddress() (string,
error) {
On 2013/01/09 16:24:47, rog wrote:
> shouldn't this follow the same scheme?
> 
> then this function could just be:
> return ctx.unit.PublicAddress()

Done.

https://codereview.appspot.com/7063055/diff/1/worker/uniter/context.go#newcode67
worker/uniter/context.go:67: func (ctx *HookContext) PrivateAddress() (string,
error) {
On 2013/01/09 16:24:47, rog wrote:
> as above

Done.
Sign in to reply to this message.

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