Add missing attribute to Subnet resource

The use_default_subnet_pool attribute was missing, leading to errors when
trying to create a subnet using the default subnet pool.

Change-Id: I72c0be77d96f3891748cdd69c382211dc20dbf5e
Partial-Bug: 1668223
This commit is contained in:
Jens Rosenboom 2017-02-27 12:09:39 +01:00
parent 847f771d44
commit 0d044b2ecd
2 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class Subnet(resource.Resource):
is_dhcp_enabled='enable_dhcp',
project_id='tenant_id',
subnet_pool_id='subnetpool_id',
use_default_subnet_pool='use_default_subnetpool',
)
# Properties
@ -81,3 +82,8 @@ class Subnet(resource.Resource):
subnet_pool_id = resource.Body('subnetpool_id')
#: Timestamp when the subnet was last updated.
updated_at = resource.Body('updated_at')
#: Whether to use the default subnet pool to obtain a CIDR.
use_default_subnet_pool = resource.Body(
'use_default_subnetpool',
type=bool
)

View File

@ -36,6 +36,7 @@ EXAMPLE = {
'subnetpool_id': '16',
'tenant_id': '17',
'updated_at': '18',
'use_default_subnetpool': True,
}
@ -75,3 +76,4 @@ class TestSubnet(testtools.TestCase):
self.assertEqual(EXAMPLE['subnetpool_id'], sot.subnet_pool_id)
self.assertEqual(EXAMPLE['tenant_id'], sot.project_id)
self.assertEqual(EXAMPLE['updated_at'], sot.updated_at)
self.assertTrue(sot.use_default_subnet_pool)