diff options
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 3 | ||||
-rw-r--r-- | yardstick/benchmark/contexts/model.py | 1 | ||||
-rw-r--r-- | yardstick/orchestrator/heat.py | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index aa134d694..fed8fc342 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -152,7 +152,8 @@ class HeatContext(Context): for network in self.networks.values(): template.add_network(network.stack_name, network.physical_network, - network.provider) + network.provider, + network.segmentation_id) template.add_subnet(network.subnet_stack_name, network.stack_name, network.subnet_cidr) diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py index 1f8c6f11c..5077a9786 100644 --- a/yardstick/benchmark/contexts/model.py +++ b/yardstick/benchmark/contexts/model.py @@ -107,6 +107,7 @@ class Network(Object): self.router = None self.physical_network = attrs.get('physical_network', 'physnet1') self.provider = attrs.get('provider', None) + self.segmentation_id = attrs.get('segmentation_id', None) if "external_network" in attrs: self.router = Router("router", self.name, diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py index a99d4631d..fd6c4f6ff 100644 --- a/yardstick/orchestrator/heat.py +++ b/yardstick/orchestrator/heat.py @@ -1,4 +1,4 @@ -############################################################################## +############################################################################# # Copyright (c) 2015-2017 Ericsson AB and others. # # All rights reserved. This program and the accompanying materials @@ -230,7 +230,8 @@ name (i.e. %s).\ 'value': {'get_resource': name} } - def add_network(self, name, physical_network='physnet1', provider=None): + def add_network(self, name, physical_network='physnet1', provider=None, + segmentation_id=None): """add to the template a Neutron Net""" log.debug("adding Neutron::Net '%s'", name) if provider is None: @@ -247,6 +248,9 @@ name (i.e. %s).\ 'physical_network': physical_network } } + if segmentation_id: + seg_id_dit = {'segmentation_id': segmentation_id} + self.resources[name]["properties"].update(seg_id_dit) def add_server_group(self, name, policies): # pragma: no cover """add to the template a ServerGroup""" |