Update subnet data model to include subnetpool_id

Adds the subnetpool_id attribute being introduced by subnet-allocation.

See: https://review.openstack.org/#/c/157597/

Includes a test workaround to be removed once the above patch is merged.

Change-Id: I2e18573654850ff06d96e3616c41d0c3647e1b28
Partially-Implements: blueprint subnet-allocation
This commit is contained in:
John Davidge 2015-03-27 12:43:07 +00:00
parent 42a7e0b957
commit d35632f1da
2 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class Subnet(BaseDataModel):
ip_version=None, cidr=None, gateway_ip=None, enable_dhcp=None,
ipv6_ra_mode=None, ipv6_address_mode=None, shared=None,
dns_nameservers=None, host_routes=None,
allocation_pools=None):
allocation_pools=None, subnetpool_id=None):
self.id = id
self.name = name
self.tenant_id = tenant_id
@ -151,6 +151,7 @@ class Subnet(BaseDataModel):
self.dns_nameservers = dns_nameservers
self.host_routes = host_routes
self.allocation_pools = allocation_pools
self.subnetpool_id = subnetpool_id
@classmethod
def from_dict(cls, model_dict):

View File

@ -152,6 +152,9 @@ class TestLoadBalancerCallbacks(
expected_lb['provider']['device_driver'] = 'dummy'
subnet = self.plugin_instance.db._core_plugin.get_subnet(
ctx, expected_lb['vip_subnet_id'])
# TODO(john-davidge) - Remove once neutron subnet-allocation
# BP is merged
subnet['subnetpool_id'] = None
expected_lb['vip_port']['fixed_ips'][0]['subnet'] = subnet
del expected_lb['stats']
self.assertEqual(expected_lb, load_balancer)