rackerlabs/quark — pull request #195 by Cerberus98 (2014-08-21 23:44:58+00:00)
Title: RM981

As per the Neutron documentation, when setting a gateway IP on a subnet
and that IP exists WITHIN said subnet, an allocation pool must prevent
that IP from being assignable. Because we also have ip policies and routes,
this patch provides checking on routes and ip policy changes. Because of
the number of cases to cover, I aggregated the majority of the necessary
pool logic into a new AllocationPools class.

The following cases are covered by this patch:

* Creating a subnet with allocation_pools and routes
* Updating a subnet with allocation_pools, routes and policies
* Creating a route with existing ip_policies
* Updating an existing ip_policy that previously excluded a route gateway

Creating a new policy with existing routes isn't capable of suddenly
allowing a route gateway to be assigned when it was previously
disallowed, so that case doesn't require additional handling.