StaticIPAddress.objects.allocate_new should take a subnet and requested_address
Bug #1539248 reported by
Blake Rouse
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Mike Pontillo |
Bug Description
With the new model StaticIPAddress
'static_range_low', 'static_
This is because that method should always take a subnet and should allocate the IP address either from the provided requested_address or by selecting the next available. That code should remove all in use IPRange's as well so that allocating a new IP address does not occur in used ranges.
I did a quick work around this in the api/ip_addresses, but it is wrong and needs to be fixed with the new IPRange model work.
Related branches
lp:~mpontillo/maas/fix-staticipaddress-allocate-new
- Blake Rouse (community): Approve
-
Diff: 1322 lines (+410/-393)12 files modifiedsrc/maasserver/api/ip_addresses.py (+0/-15)
src/maasserver/api/tests/test_machine.py (+5/-5)
src/maasserver/api/tests/test_subnets.py (+9/-5)
src/maasserver/migrations/builtin/maasserver/0033_iprange_minor_changes.py (+40/-0)
src/maasserver/models/interface.py (+4/-41)
src/maasserver/models/iprange.py (+3/-0)
src/maasserver/models/staticipaddress.py (+20/-91)
src/maasserver/models/subnet.py (+95/-13)
src/maasserver/models/tests/test_interface.py (+100/-77)
src/maasserver/models/tests/test_staticipaddress.py (+89/-132)
src/maasserver/testing/factory.py (+38/-7)
src/maasserver/tests/test_node_action.py (+7/-7)
Changed in maas: | |
assignee: | nobody → Mike Pontillo (mpontillo) |
summary: |
- Subnet.objects.allocate_new should take a subnet and requested_address + StaticIPAddress.objects.allocate_new should take a subnet and + requested_address |
description: | updated |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.