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

Issue 13604045: cmd/jujud: Fix agent openAPIState (Closed)

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

Description

cmd/jujud: Fix agent openAPIState This changes agent.openAPIState to handle better unauthorized errors, so in case the connection to state failed or the entity cannot be found after connecting it'll return worker.ErrTerminateAgent as expected. https://code.launchpad.net/~dimitern/juju-core/133-agent-fix-openapistate/+merge/185119 Requires: https://code.launchpad.net/~dimitern/juju-core/133-apiuniter-uses-api/+merge/185091 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : cmd/jujud: Fix agent openAPIState #

Total comments: 2

Patch Set 3 : cmd/jujud: Fix agent openAPIState #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -1 line) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent.go View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M cmd/jujud/unit_test.go View 1 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 5
dimitern
Please take a look.
10 years, 7 months ago (2013-09-11 18:01:37 UTC) #1
fwereade
Looks fine, but NOT LGTM without a test.
10 years, 7 months ago (2013-09-12 09:22:07 UTC) #2
dimitern
Please take a look.
10 years, 7 months ago (2013-09-12 13:38:44 UTC) #3
fwereade
LGTM with a trivial. Doesn't have to be exactly what I suggest, just a bit ...
10 years, 7 months ago (2013-09-12 14:08:05 UTC) #4
dimitern
10 years, 7 months ago (2013-09-12 14:15:14 UTC) #5
Please take a look.

https://codereview.appspot.com/13604045/diff/5001/cmd/jujud/agent.go
File cmd/jujud/agent.go (right):

https://codereview.appspot.com/13604045/diff/5001/cmd/jujud/agent.go#newcode157
cmd/jujud/agent.go:157: err == nil && entity.Life() == params.Dead {
On 2013/09/12 14:08:05, fwereade wrote:
> Honestly, this is too much for me. The following may be more verbose, but I'd
> much prefer it:
> 
> unauthorized := params.ErrCode(err) == params.CodeUnauthorized
> dead := err == nil && entity.Life() == params.Dead
> if unauthorized || dead {
>     err = ErrTerminateAgent
> }

Done.
Sign in to reply to this message.

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