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

Issue 78890043: state/api: implement APIHostPorts methods

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

Description

state/api: implement APIHostPorts methods We also refactor the API client tests a little, factoring out the API address-related tests into their own suite alongside the existing EnvironWatcherTests. Some changes to existing code: EnvironWatcherTest renamed to EnvironWatcherTests because plural seems better when it's there for multiple tests. I don't see a particular use for passing the backing state separately to NewEnvironWatcherTests, when the backing state will do for both purposes. The error field in the return from EnvironConfig is redundant, so has been removed. Any client should be checking the error return from the API call anyway, so it should not have any adverse effect. api/common/testing moved to api/testing - because "apitesting" seems like a nice import identifier and it will be a good place to have other api-related test functionality if we need it. https://code.launchpad.net/~rogpeppe/juju-core/526-APIHostPorts-api/+merge/212219 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state/api: implement APIHostPorts methods #

Patch Set 3 : state/api: implement APIHostPorts methods #

Total comments: 17

Patch Set 4 : state/api: implement APIHostPorts methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -277 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A state/api/common/apiaddresser.go View 1 2 3 1 chunk +71 lines, -0 lines 0 comments Download
M state/api/common/environwatcher.go View 1 2 3 1 chunk +9 lines, -16 lines 0 comments Download
M state/api/deployer/deployer.go View 2 chunks +6 lines, -21 lines 0 comments Download
M state/api/deployer/deployer_test.go View 1 5 chunks +6 lines, -23 lines 0 comments Download
M state/api/environment/environment_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M state/api/firewaller/firewaller.go View 1 chunk +0 lines, -3 lines 0 comments Download
M state/api/machiner/machiner.go View 1 chunk +6 lines, -1 line 0 comments Download
M state/api/machiner/machiner_test.go View 1 8 chunks +17 lines, -8 lines 0 comments Download
M state/api/params/internal.go View 2 chunks +8 lines, -2 lines 0 comments Download
M state/api/provisioner/provisioner.go View 1 5 chunks +14 lines, -29 lines 0 comments Download
M state/api/provisioner/provisioner_test.go View 1 5 chunks +7 lines, -23 lines 0 comments Download
M state/api/rsyslog/rsyslog_test.go View 2 chunks +4 lines, -5 lines 0 comments Download
A state/api/testing/apiaddresser.go View 1 2 3 1 chunk +101 lines, -0 lines 0 comments Download
M state/api/testing/environwatcher.go View 2 chunks +21 lines, -19 lines 0 comments Download
M state/api/uniter/charm.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M state/api/uniter/relationunit.go View 1 5 chunks +5 lines, -5 lines 0 comments Download
M state/api/uniter/service.go View 1 4 chunks +4 lines, -4 lines 0 comments Download
M state/api/uniter/settings.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/api/uniter/state_test.go View 1 2 3 2 chunks +8 lines, -26 lines 0 comments Download
M state/api/uniter/unit.go View 1 19 chunks +19 lines, -19 lines 0 comments Download
M state/api/uniter/uniter.go View 1 2 8 chunks +16 lines, -22 lines 0 comments Download
M state/api/uniter/uniter_test.go View 2 chunks +0 lines, -15 lines 0 comments Download
M state/apiserver/common/addresses.go View 4 chunks +42 lines, -14 lines 0 comments Download
M state/apiserver/common/addresses_test.go View 4 chunks +17 lines, -6 lines 0 comments Download
M state/apiserver/common/environwatcher.go View 2 chunks +3 lines, -1 line 0 comments Download
M state/apiserver/common/environwatcher_test.go View 4 chunks +1 line, -4 lines 0 comments Download
M state/apiserver/common/testing/environwatcher.go View 1 chunk +0 lines, -1 line 0 comments Download
M state/apiserver/deployer/deployer.go View 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/machine/machiner.go View 2 chunks +2 lines, -0 lines 0 comments Download
M state/apiserver/provisioner/provisioner.go View 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/uniter/uniter.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
rog
Please take a look.
10 years, 1 month ago (2014-03-21 18:48:01 UTC) #1
dimitern
LGTM, I like the simplification! Some minor suggestions and questions below: https://codereview.appspot.com/78890043/diff/40001/state/api/common/apiaddresser.go File state/api/common/apiaddresser.go (right): ...
10 years, 1 month ago (2014-03-24 09:15:59 UTC) #2
rog
10 years, 1 month ago (2014-03-24 10:33:47 UTC) #3
Please take a look.

https://codereview.appspot.com/78890043/diff/40001/state/api/common/apiaddres...
File state/api/common/apiaddresser.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/api/common/apiaddres...
state/api/common/apiaddresser.go:13: type APIAddresser struct {
On 2014/03/24 09:15:59, dimitern wrote:
> doc comment

Done.

https://codereview.appspot.com/78890043/diff/40001/state/api/common/apiaddres...
state/api/common/apiaddresser.go:18: // NewAPIAddresser returns
On 2014/03/24 09:15:59, dimitern wrote:
> returns... some day? :)

Done.

https://codereview.appspot.com/78890043/diff/40001/state/api/common/apiaddres...
state/api/common/apiaddresser.go:40: // CACert returns the certificate used to
validate the state connection.
On 2014/03/24 09:15:59, dimitern wrote:
> state only? or both state and API?

Done.

https://codereview.appspot.com/78890043/diff/40001/state/api/firewaller/firew...
File state/api/firewaller/firewaller.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/api/firewaller/firew...
state/api/firewaller/firewaller.go:71: // EnvironConfig returns the current
environment configuration.
On 2014/03/24 09:15:59, dimitern wrote:
> Why not change the firewaller API to use common environwatcher as well?

will do, in a subsequent CL.

https://codereview.appspot.com/78890043/diff/40001/state/api/provisioner/prov...
File state/api/provisioner/provisioner.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/api/provisioner/prov...
state/api/provisioner/provisioner.go:24: const provisionerFacade = "Provisioner"
On 2014/03/24 09:15:59, dimitern wrote:
> Why using a const only here? I'd pick one - always use a const for a facade
name
> or never.

I'll change the rest of the occurrences in a subsequent CL.

https://codereview.appspot.com/78890043/diff/40001/state/api/testing/apiaddre...
File state/api/testing/apiaddresser.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/api/testing/apiaddre...
state/api/testing/apiaddresser.go:3: package testing
On 2014/03/24 09:15:59, dimitern wrote:
> Blank line before package line.

Done.

https://codereview.appspot.com/78890043/diff/40001/state/api/uniter/state_tes...
File state/api/uniter/state_test.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/api/uniter/state_tes...
state/api/uniter/state_test.go:9: gc "launchpad.net/gocheck"
On 2014/03/24 09:15:59, dimitern wrote:
> gocheck goes before juju-core imports

Done.

https://codereview.appspot.com/78890043/diff/40001/state/apiserver/common/add...
File state/apiserver/common/addresses.go (right):

https://codereview.appspot.com/78890043/diff/40001/state/apiserver/common/add...
state/apiserver/common/addresses.go:62: // TODO(rog) change this to use
api.st.APIHostPorts()
On 2014/03/24 09:15:59, dimitern wrote:
> Why not change it now?

Because the API addresses collection used by APIHostPorts is
not yet populated (it needs the peergrouper worker to
be integrated into jujud, which hasn't happened yet)
Sign in to reply to this message.

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