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

Issue 79250044: state: Add Machine.Networks() and create them (Closed)

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

Description

state: Add Machine.Networks() and create them This adds a new method to state.Machine: Networks(), which returns any associated networks to include or exclude for the machine. Added a couple of extra fields to state.MachineTemplate: IncludeNetworks and ExcludeNetworks. Each time a new machine or container is created, if these are populated, they will be also saved in state for the machine, as a linked networksDoc. A few drive-by fixes for naming consistency, including changing Included/ExcludedNetworks across the codebase to Include/ExcludeNetworks to better illustrate the intent (i.e. we're saying what networks should be included or excluded, not how the reality is yet - we can do that post-provisioning only). Added tests to ensure when the new networkDocs are missing for a service/machine .Networks() still works and returns nil error, as suggested in reviews. https://code.launchpad.net/~dimitern/juju-core/360-state-machine-networks/+merge/212418 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6

Patch Set 2 : state: Add Machine.Networks() and create them #

Total comments: 7

Patch Set 3 : state: Add Machine.Networks() and create them #

Patch Set 4 : state: Add Machine.Networks() and create them #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -36 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M environs/broker.go View 1 2 2 chunks +4 lines, -6 lines 0 comments Download
M provider/maas/environ.go View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M provider/maas/environ_whitebox_test.go View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M state/addmachine.go View 1 2 6 chunks +20 lines, -7 lines 0 comments Download
M state/cleanup.go View 2 chunks +13 lines, -0 lines 0 comments Download
M state/compat_test.go View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
M state/machine.go View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M state/machine_test.go View 1 2 3 chunks +37 lines, -1 line 0 comments Download
M state/networks.go View 1 2 2 chunks +12 lines, -11 lines 0 comments Download
M state/service_test.go View 1 2 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 10
dimitern
Please take a look.
10 years, 1 month ago (2014-03-24 13:47:48 UTC) #1
fwereade
Needs tests for upgraded environments, otherwise looking good. Otherwise ust trivials. https://codereview.appspot.com/79250044/diff/1/state/machine.go File state/machine.go (right): ...
10 years, 1 month ago (2014-03-24 14:01:55 UTC) #2
dimitern
Please take a look. https://codereview.appspot.com/79250044/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/79250044/diff/1/state/machine.go#newcode884 state/machine.go:884: // Networks returns the list ...
10 years, 1 month ago (2014-03-24 16:20:40 UTC) #3
gz
LGTM, naming quibble. https://codereview.appspot.com/79250044/diff/1/state/addmachine.go File state/addmachine.go (right): https://codereview.appspot.com/79250044/diff/1/state/addmachine.go#newcode62 state/addmachine.go:62: ExcludedNetworks []string Naming quibble, I've been ...
10 years, 1 month ago (2014-03-24 16:35:01 UTC) #4
fwereade
Fix the error from readNetworks, and I think we're good to go. https://codereview.appspot.com/79250044/diff/20001/state/compat_test.go File state/compat_test.go ...
10 years, 1 month ago (2014-03-24 16:35:43 UTC) #5
fwereade
On 2014/03/24 16:35:01, gz wrote: > LGTM, naming quibble. > > https://codereview.appspot.com/79250044/diff/1/state/addmachine.go > File state/addmachine.go ...
10 years, 1 month ago (2014-03-24 16:39:25 UTC) #6
fwereade
On 2014/03/24 16:39:25, fwereade wrote: > On 2014/03/24 16:35:01, gz wrote: > > LGTM, naming ...
10 years, 1 month ago (2014-03-24 16:40:24 UTC) #7
dimitern
Please take a look. https://codereview.appspot.com/79250044/diff/1/state/addmachine.go File state/addmachine.go (right): https://codereview.appspot.com/79250044/diff/1/state/addmachine.go#newcode62 state/addmachine.go:62: ExcludedNetworks []string On 2014/03/24 16:35:02, ...
10 years, 1 month ago (2014-03-25 09:22:21 UTC) #8
fwereade
LGTM, thanks.
10 years, 1 month ago (2014-03-25 09:26:21 UTC) #9
dimitern
10 years, 1 month ago (2014-03-25 09:34:10 UTC) #10
Please take a look.
Sign in to reply to this message.

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