Merge lp:~allenap/maas/find-nodegroup-redux into lp:~maas-committers/maas/trunk
Proposed by
Gavin Panella
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andres Rodriguez | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1457 | ||||
Proposed branch: | lp:~allenap/maas/find-nodegroup-redux | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
261 lines (+124/-70) 3 files modified
src/maasserver/exceptions.py (+10/-0) src/maasserver/utils/__init__.py (+50/-25) src/maasserver/utils/tests/test_utils.py (+64/-45) |
||||
To merge this branch: | bzr merge lp:~allenap/maas/find-nodegroup-redux | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andres Rodriguez (community) | Approve | ||
Julian Edwards (community) | Approve | ||
Review via email: mp+157238@code.launchpad.net |
Commit message
Find the requester's cluster controller by also matching unmanaged interfaces.
This allows MAAS installations that use custom DHCP servers to be supported. In addition, multiple cluster controllers can have interfaces on the same network. At most one of these interfaces can be "managed"; any more and an error will result. If multiple non-managed interfaces exist the first one to have been recorded in MAAS wins, and its cluster controller is chosen.
To post a comment you must log in.
Very nice branch! Clear code, clear commenting and very easy to follow. Great work.
225 + def test_more_ than_1_ unmanaged_ interface( self): make_node_ group( NODEGROUPINTERF ACE_MANAGEMENT. UNMANAGED, IPNetwork( "192.168. 41.0/16" )) make_node_ group( NODEGROUPINTERF ACE_MANAGEMENT. UNMANAGED, IPNetwork( "192.168. 41.0/24" )) get_request( '192.168. 41.199' )),
226 + nodegroup1 = factory.
227 + management=
228 + network=
229 + nodegroup2 = factory.
230 + management=
231 + network=
232 + self.assertIn(
233 + find_nodegroup(
234 + {nodegroup1, nodegroup2})
Since the query to find the interfaces is deterministic, should it check for a particular nodegroup?