summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_network.py
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-08-17 08:09:07 +0000
committerLinda Wang <wangwulin@huawei.com>2017-08-18 19:55:00 +0000
commite7b96a812bb7b30416b4adb24ef0f22666687c10 (patch)
treeba4449db8df2dd2f832e1070caad258148d4401d /snaps/openstack/create_network.py
parentacc4428e76422ad5c60f5433f325258214e6bc3b (diff)
Specify segmentation_id when creating network
When the network_type is vlan, it is necessary to specify physical_network and segmentation_id. JIRA: FUNCTEST-863 Change-Id: I44f57cdd825ee3cde7adb946c4f8dc78e3ee5212 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'snaps/openstack/create_network.py')
-rw-r--r--snaps/openstack/create_network.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/snaps/openstack/create_network.py b/snaps/openstack/create_network.py
index c3fb575..d0b6d20 100644
--- a/snaps/openstack/create_network.py
+++ b/snaps/openstack/create_network.py
@@ -149,6 +149,8 @@ class NetworkSettings:
:param network_type: the type of network (i.e. vlan|flat).
:param physical_network: the name of the physical network
(this is required when network_type is 'flat')
+ :param segmentation_id: the id of the segmentation
+ (this is required when network_type is 'vlan')
:param subnets or subnet_settings: List of SubnetSettings objects.
:return:
"""
@@ -175,6 +177,7 @@ class NetworkSettings:
self.network_type = kwargs.get('network_type')
self.physical_network = kwargs.get('physical_network')
+ self.segmentation_id = kwargs.get('segmentation_id')
self.subnet_settings = list()
subnet_settings = kwargs.get('subnets')
@@ -239,6 +242,8 @@ class NetworkSettings:
out['provider:network_type'] = self.network_type
if self.physical_network:
out['provider:physical_network'] = self.physical_network
+ if self.segmentation_id:
+ out['provider:segmentation_id'] = self.segmentation_id
if self.external:
out['router:external'] = self.external
return {'network': out}