From 545eec2fe4fc1c59e68fa1cebb6a9cfdfdcd6927 Mon Sep 17 00:00:00 2001 From: Sumit Naiksatam Date: Fri, 22 Apr 2016 13:01:40 -0700 Subject: [PATCH] Add service profile ID prop for service chain node Change-Id: I1c307be9ff5b8ddd5c3ec08a8b3cbfacc15c4966 Closes-Bug: 1573784 --- gbpautomation/heat/engine/resources/servicechain.py | 12 ++++++++++-- gbpautomation/heat/tests/test_servicechain.py | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gbpautomation/heat/engine/resources/servicechain.py b/gbpautomation/heat/engine/resources/servicechain.py index b0c4d33..c294a18 100644 --- a/gbpautomation/heat/engine/resources/servicechain.py +++ b/gbpautomation/heat/engine/resources/servicechain.py @@ -22,9 +22,11 @@ from neutronclient.common.exceptions import NeutronClientException class ServiceChainNode(gbpresource.GBPResource): PROPERTIES = ( - TENANT_ID, NAME, DESCRIPTION, SERVICE_TYPE, CONFIG, SHARED + TENANT_ID, NAME, DESCRIPTION, SERVICE_TYPE, SERVICE_PROFILE_ID, + CONFIG, SHARED ) = ( - 'tenant_id', 'name', 'description', 'service_type', 'config', 'shared' + 'tenant_id', 'name', 'description', 'service_type', + 'service_profile_id', 'config', 'shared' ) properties_schema = { @@ -45,6 +47,12 @@ class ServiceChainNode(gbpresource.GBPResource): SERVICE_TYPE: properties.Schema( properties.Schema.STRING, _('Type of service in the service chain node.'), + required=False, + update_allowed=True + ), + SERVICE_PROFILE_ID: properties.Schema( + properties.Schema.STRING, + _('ID of the Service Profile for this Node.'), required=True, update_allowed=True ), diff --git a/gbpautomation/heat/tests/test_servicechain.py b/gbpautomation/heat/tests/test_servicechain.py index 69376b2..bfd7e9e 100644 --- a/gbpautomation/heat/tests/test_servicechain.py +++ b/gbpautomation/heat/tests/test_servicechain.py @@ -35,7 +35,7 @@ servicechain_node_template = ''' "name": "test-sc-node", "description": "test service chain node resource", "shared": True, - "service_type": "TAP", + "service_profile_id": "profile-id", "config": "{'name': 'sc_node_config'}" } } @@ -100,7 +100,7 @@ class ServiceChainNodeTest(HeatTestCase): 'servicechain_node': { "name": "test-sc-node", "description": "test service chain node resource", - "service_type": "TAP", + "service_profile_id": "profile-id", "shared": True, "config": "{'name': 'sc_node_config'}" } @@ -125,7 +125,7 @@ class ServiceChainNodeTest(HeatTestCase): 'servicechain_node': { "name": "test-sc-node", "description": "test service chain node resource", - "service_type": "TAP", + "service_profile_id": "profile-id", "shared": True, "config": "{'name': 'sc_node_config'}" }