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

Issue 6642060: uniter: HookContext.Config is now consistent

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

Description

uniter: HookContext.Config is now consistent fixes lp:1063619 https://code.launchpad.net/~fwereade/juju-core/consistent-config-in-hook/+merge/128992 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : uniter: HookContext.Config is now consistent #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -17 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M worker/uniter/context.go View 1 2 chunks +20 lines, -14 lines 0 comments Download
M worker/uniter/context_test.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M worker/uniter/uniter.go View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 3
fwereade
Please take a look.
11 years, 6 months ago (2012-10-10 16:26:40 UTC) #1
niemeyer
LGTM, except for the drop of service from HookContext. https://codereview.appspot.com/6642060/diff/1/worker/uniter/context.go File worker/uniter/context.go (left): https://codereview.appspot.com/6642060/diff/1/worker/uniter/context.go#oldcode41 worker/uniter/context.go:41: ...
11 years, 6 months ago (2012-10-10 18:47:30 UTC) #2
fwereade
11 years, 6 months ago (2012-10-10 21:48:33 UTC) #3
*** Submitted:

uniter: HookContext.Config is now consistent

fixes lp:1063619

R=niemeyer
CC=
https://codereview.appspot.com/6642060

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

https://codereview.appspot.com/6642060/diff/1/worker/uniter/context.go#oldcode41
worker/uniter/context.go:41: func NewHookContext(service *state.Service, unit
*state.Unit, id string, relationId int, remoteUnitName string, relations
map[int]*ContextRelation) *HookContext {
On 2012/10/10 18:47:30, niemeyer wrote:
> This is the case we were talking about when I suggested unit.Service() was a
bad
> idea. The caller of this function generally will hold the service already.
> There's no reason for us to be forcing the logic within the context to be
> reloading the service every time it needs to look at the service again. I
> suggest preserving the service field as we had before, and using it as needed.

Done.

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

https://codereview.appspot.com/6642060/diff/1/worker/uniter/context.go#newcode22
worker/uniter/context.go:22: // config holds the service's config.
On 2012/10/10 18:47:30, niemeyer wrote:
> // config holds the service configuration.

Done.
Sign in to reply to this message.

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