Adding Subnet ID to External Segment

This is required for Neutron mapping.

Change-Id: Ia7e21b494feb2140d0b1f27e556523b3f8f3a45e
Closes-bug: 1420626
This commit is contained in:
Sumit Naiksatam 2015-02-10 22:07:38 -08:00
parent 93882f6ead
commit e4451d9479
2 changed files with 12 additions and 3 deletions

View File

@ -907,11 +907,12 @@ class ExternalPolicy(gbpresource.GBPResource):
class ExternalSegment(gbpresource.GBPResource):
PROPERTIES = (
TENANT_ID, NAME, DESCRIPTION, IP_VERSION, CIDR,
TENANT_ID, NAME, DESCRIPTION, IP_VERSION, CIDR, SUBNET_ID,
EXTERNAL_ROUTES, PORT_ADDRESS_TRANSLATION, SHARED
) = (
'tenant_id', 'name', 'description', 'ip_version', 'cidr',
'external_routes', 'port_address_translation', 'shared'
'subnet_id', 'external_routes', 'port_address_translation',
'shared'
)
properties_schema = {
@ -939,6 +940,11 @@ class ExternalSegment(gbpresource.GBPResource):
_('CIDR of the external segment.'),
default=None, update_allowed=False
),
SUBNET_ID: properties.Schema(
properties.Schema.STRING,
_('Subnet ID of the neutron external network.'),
default=None, update_allowed=False
),
EXTERNAL_ROUTES: properties.Schema(
properties.Schema.LIST,
_('External routes of the external segment.'),
@ -947,7 +953,7 @@ class ExternalSegment(gbpresource.GBPResource):
PORT_ADDRESS_TRANSLATION: properties.Schema(
properties.Schema.BOOLEAN,
_('Port address translation required for the external segment.'),
update_allowed=True, required=True
update_allowed=True, default=False
),
SHARED: properties.Schema(
properties.Schema.BOOLEAN,

View File

@ -263,6 +263,7 @@ external_segment_template = '''
"description": "test ES resource",
"ip_version": '6',
"cidr": "192.168.0.0/24",
"subnet_id": "some-subnet-id",
"external_routes": [{
"destination": "0.0.0.0/0",
"nexthop": "null"
@ -1516,6 +1517,7 @@ class ExternalSegmentTest(HeatTestCase):
"description": "test ES resource",
"ip_version": '6',
"cidr": "192.168.0.0/24",
"subnet_id": "some-subnet-id",
"external_routes": [{
"destination": "0.0.0.0/0",
"nexthop": "null"
@ -1546,6 +1548,7 @@ class ExternalSegmentTest(HeatTestCase):
"description": "test ES resource",
"ip_version": '6',
"cidr": "192.168.0.0/24",
"subnet_id": "some-subnet-id",
"external_routes": [{
"destination": "0.0.0.0/0",
"nexthop": "null"