StaticIPAddress.objects.allocate_new should take a subnet and requested_address

Bug #1539248 reported by Blake Rouse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Mike Pontillo

Bug Description

With the new model StaticIPAddress.objects.allocate_new should not need the following fields:

'static_range_low', 'static_range_high', 'dynamic_range_low', and 'dynamic_range_high'

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.

Tags: networking

Related branches

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.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.