Add network_id field for L2 Policy Heat Extensions.

Change-Id: I743d22986e31b644bfaa6e5590ec29db11494627
(cherry picked from commit c4e1f574d6)
This commit is contained in:
Sayali Naval
2020-11-18 15:59:47 -08:00
committed by Sayali Vidyadhar Naval
parent 8a63b48af2
commit 711875a052
2 changed files with 12 additions and 3 deletions

View File

@@ -378,10 +378,11 @@ class PolicyTargetGroup(gbpresource.GBPResource):
class L2Policy(gbpresource.GBPResource): class L2Policy(gbpresource.GBPResource):
PROPERTIES = ( PROPERTIES = (
TENANT_ID, NAME, DESCRIPTION, L3_POLICY_ID, SHARED, REUSE_BD TENANT_ID, NAME, DESCRIPTION, L3_POLICY_ID,
SHARED, REUSE_BD, NETWORK_ID
) = ( ) = (
'tenant_id', 'name', 'description', 'l3_policy_id', 'shared', 'tenant_id', 'name', 'description', 'l3_policy_id', 'shared',
'reuse_bd' 'reuse_bd', 'network_id'
) )
properties_schema = { properties_schema = {
@@ -414,6 +415,11 @@ class L2Policy(gbpresource.GBPResource):
properties.Schema.STRING, properties.Schema.STRING,
_('Existing L2P ID in same L3P.'), _('Existing L2P ID in same L3P.'),
default=None, update_allowed=False default=None, update_allowed=False
),
NETWORK_ID: properties.Schema(
properties.Schema.STRING,
_('Network ID of the L2 policy.'),
update_allowed=False
) )
} }

View File

@@ -164,7 +164,8 @@ l2_policy_template = '''
"description": "test L2 policy resource", "description": "test L2 policy resource",
"l3_policy_id": "l3-policy-id", "l3_policy_id": "l3-policy-id",
"shared": True, "shared": True,
"reuse_bd": "other-l2p" "reuse_bd": "other-l2p",
"network_id": "network-id"
} }
} }
} }
@@ -993,6 +994,7 @@ class L2PolicyTest(HeatTestCase):
"l3_policy_id": "l3-policy-id", "l3_policy_id": "l3-policy-id",
"shared": True, "shared": True,
"reuse_bd": "other-l2p", "reuse_bd": "other-l2p",
"network_id": "network-id",
} }
} }
tdict = {'l2_policy': {'id': '5678'}} tdict = {'l2_policy': {'id': '5678'}}
@@ -1023,6 +1025,7 @@ class L2PolicyTest(HeatTestCase):
"l3_policy_id": "l3-policy-id", "l3_policy_id": "l3-policy-id",
"shared": True, "shared": True,
"reuse_bd": "other-l2p", "reuse_bd": "other-l2p",
"network_id": "network-id",
} }
} }
exc = grouppolicy.NeutronClientException() exc = grouppolicy.NeutronClientException()