Merge lp:~julian-edwards/maas/consider-static-range into lp:~maas-committers/maas/trunk
Proposed by
Julian Edwards
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2696 | ||||
Proposed branch: | lp:~julian-edwards/maas/consider-static-range | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
107 lines (+33/-9) 2 files modified
src/maasserver/api.py (+12/-3) src/maasserver/tests/test_api_nodegroup.py (+21/-6) |
||||
To merge this branch: | bzr merge lp:~julian-edwards/maas/consider-static-range | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+230760@code.launchpad.net |
Commit message
Consider the static IP range, if configured, when linking MAC addresses to networks and cluster interfaces. This ensures that pre-existing nodes already using the static range will get linked.
Description of the change
The update_
I hesitated to break it up anyway because everything in there is closely tied. Ideally it would be namespaced in a class to indicate that fact.
Anyway, api.py is 4000 lines long now. If we're going to split things up ...
To post a comment you must log in.
"Everything is closely tied" is not a reason not to break things up; it's a reason to put more effort into breaking them up! Such irredeemable patches of code tend to spread like oil slicks. There's clearly stuff here that could be extracted, and make the code cleaner for it. I see loops that could do with a name, a docstring, or at least a comment.
One question about the design of this branch: why would you look just at the static range, and not at the network's full address range? Does it matter for the purpose of linking a node's network interface to a subnet whether the address is in the static range? If I reduced the static range after a node had already acquired a static address, so that the address is now outside the static range, should that affect whether this could makes the link? Wouldn't be a check against the network be more robust, as well as faster (because IPRange is so awful about “in”) and simpler?