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

Issue 86430043: Add check for requested networks compatibility

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by hduran
Modified:
10 years ago
Reviewers:
mp+215143, fwereade
Visibility:
Public.

Description

Add check for requested networks compatibility This is still work in progress, the idea is to check if the requested networks for a unit and for a machine are compatible. So far check looks that there is no requesting to inlude nets excluded in the other and vice versa. https://code.launchpad.net/~hduran-8/juju-core/add_state_network_check_on_specified_machine/+merge/215143 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Add check for requested networks compatibility #

Total comments: 13

Patch Set 3 : Add check for requested networks compatibility #

Total comments: 4

Patch Set 4 : Add check for requested networks compatibility #

Unified diffs Side-by-side diffs Delta from patch set Stats (+280 lines, -68 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M state/machine.go View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
A state/network_assign_test.go View 1 2 3 1 chunk +88 lines, -0 lines 0 comments Download
M state/unit.go View 1 2 3 6 chunks +148 lines, -68 lines 0 comments Download

Messages

Total messages: 3
fwereade
firehose of suggestions :) https://codereview.appspot.com/86430043/diff/20001/state/unit.go File state/unit.go (right): https://codereview.appspot.com/86430043/diff/20001/state/unit.go#newcode539 state/unit.go:539: return readRequestedNetworks(u.st, u.globalKey()) don't think ...
10 years ago (2014-04-11 09:48:47 UTC) #1
fwereade
couple of comments, let's chat live https://codereview.appspot.com/86430043/diff/40001/state/unit.go File state/unit.go (right): https://codereview.appspot.com/86430043/diff/40001/state/unit.go#newcode869 state/unit.go:869: if unit.doc.MachineId != ...
10 years ago (2014-04-17 10:06:25 UTC) #2
hduran
10 years ago (2014-04-18 23:17:14 UTC) #3
Wow i was not aware it was so bad, right now i am on holiday and on a
touristic place very far from a pc. ill Ping you on monday as soon as i
begin my day

El jueves, 17 de abril de 2014, <fwereade@gmail.com> escribió:

> couple of comments, let's chat live
>
>
> https://codereview.appspot.com/86430043/diff/40001/state/unit.go
> File state/unit.go (right):
>
> https://codereview.appspot.com/86430043/diff/40001/state/
> unit.go#newcode869
> state/unit.go:869: if unit.doc.MachineId != machine.Id() {
> This in particular needs to go inside the loop -- unit and machine
> assignments can change.
>
> (also, should we be checking that the machine's principals are empty if
> unused is true? I think we should...)
>
> https://codereview.appspot.com/86430043/diff/40001/state/
> unit.go#newcode881
> state/unit.go:881: if err := unit.st.supportsUnitPlacement(); err != nil
> {
> I don't think this is mutable state, is it? we can check it outside the
> loop.
>
> https://codereview.appspot.com/86430043/diff/40001/state/
> unit.go#newcode923
> state/unit.go:923: }
> Everything from here up to the top of the loop feels like it should all
> be inside the assignToMachineOps method -- calculating the ops and
> verifying that they're sane should go hand in hand. (this applies to
> stuff like the life checks too -- check them while building the txn,
> don't just build it blind, wait for it to fail, and then look up why.)
>
> https://codereview.appspot.com/86430043/diff/40001/state/
> unit.go#newcode940
> state/unit.go:940: case unit.doc.Life != Alive:
> You shouldn't need this code here. It should all be checked as we
> construct the transaction -- we have access to latest-known-state up at
> the top of the loop, and we can and should check unit life etc *before*
> we try to run a transaction asserting that it's the case.
>
> Apart from anything else, you're inspecting old state here -- it doesn't
> necessarily have any bearing on why the txn mechanism rejected the ops.
>
> https://codereview.appspot.com/86430043/
>
Sign in to reply to this message.

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