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

Issue 54630043: apiserver: Extract common.UnitsWatcher mixin (Closed)

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

Description

apiserver: Extract common.UnitsWatcher mixin Both the deployer and the upcoming firewaller server-side APIs have a WatchUnits() method, which is now extracted to a common.UnitsWatcher mixin in apiserver, as a prerequiste to the firewaller API implementation. The deployer is also changed to use the new mixin. https://code.launchpad.net/~dimitern/juju-core/234-apiserver-common-unitswatcher/+merge/202348 Requires: https://code.launchpad.net/~dimitern/juju-core/233-state-SortedPorts-to-instance/+merge/202347 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : apiserver: Extract common.UnitsWatcher mixin #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -163 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M instance/instance.go View 1 3 chunks +21 lines, -1 line 0 comments Download
M instance/instance_test.go View 1 1 chunk +22 lines, -0 lines 0 comments Download
M provider/azure/instance.go View 1 2 chunks +1 line, -2 lines 0 comments Download
M provider/azure/instance_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M provider/dummy/environs.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M provider/ec2/ec2.go View 1 1 chunk +1 line, -1 line 0 comments Download
M provider/openstack/provider.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/common/environwatcher.go View 1 4 chunks +9 lines, -6 lines 0 comments Download
M state/apiserver/common/environwatcher_test.go View 1 8 chunks +29 lines, -24 lines 0 comments Download
M state/apiserver/common/interfaces.go View 1 1 chunk +10 lines, -0 lines 0 comments Download
A state/apiserver/common/unitswatcher.go View 1 chunk +74 lines, -0 lines 0 comments Download
A state/apiserver/common/unitswatcher_test.go View 1 chunk +118 lines, -0 lines 0 comments Download
M state/apiserver/deployer/deployer.go View 1 4 chunks +27 lines, -62 lines 0 comments Download
M state/apiserver/provisioner/provisioner.go View 1 1 chunk +4 lines, -12 lines 0 comments Download
M state/interface.go View 1 chunk +10 lines, -0 lines 0 comments Download
M state/state_test.go View 1 1 chunk +0 lines, -18 lines 0 comments Download
M state/unit.go View 1 3 chunks +1 line, -21 lines 0 comments Download
M worker/firewaller/firewaller.go View 1 7 chunks +8 lines, -8 lines 0 comments Download
M worker/firewaller/firewaller_test.go View 1 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 3
dimitern
Please take a look.
10 years, 3 months ago (2014-01-20 17:32:24 UTC) #1
rog
LGTM with one suggestion below. https://codereview.appspot.com/54630043/diff/1/state/apiserver/deployer/deployer.go File state/apiserver/deployer/deployer.go (right): https://codereview.appspot.com/54630043/diff/1/state/apiserver/deployer/deployer.go#newcode57 state/apiserver/deployer/deployer.go:57: _, _, err := ...
10 years, 3 months ago (2014-01-21 14:21:49 UTC) #2
dimitern
10 years, 3 months ago (2014-01-21 16:03:25 UTC) #3
Please take a look.

https://codereview.appspot.com/54630043/diff/1/state/apiserver/deployer/deplo...
File state/apiserver/deployer/deployer.go (right):

https://codereview.appspot.com/54630043/diff/1/state/apiserver/deployer/deplo...
state/apiserver/deployer/deployer.go:57: _, _, err := names.ParseTag(tag,
names.MachineTagKind)
On 2014/01/21 14:21:49, rog wrote:
> Is this necessary? Surely the AuthOwner test will fail unless the tag matches
> exactly, and we know that the tag we're checking against is valid, so if the
> test succeeds, we know that ParseTag must have succeeded.
> 
> I'd just do:
> getCanWatch := func() (common.AuthFunc, error) {
>     return authorizer.AuthOwner, nil
> }

Done.
Sign in to reply to this message.

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