X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Forchestrator%2Fheat.py;h=7958b1cfb55f58f4664d9882abf4f93d072c29ab;hb=41136dafb30d0c410e92f9f7a7c19eae60f224e2;hp=a99d4631d550cc318049c05fc8c94debdc43669b;hpb=653902770572c780777d1dc7a371794b670585b1;p=yardstick.git diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py index a99d4631d..7958b1cfb 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""" @@ -560,8 +564,9 @@ name (i.e. %s).\ for status in iter(self.status, u'CREATE_COMPLETE'): log.debug("stack state %s", status) if status == u'CREATE_FAILED': - raise RuntimeError( - heat_client.stacks.get(self.uuid).stack_status_reason) + stack_status_reason = heat_client.stacks.get(self.uuid).stack_status_reason + heat_client.stacks.delete(self.uuid) + raise RuntimeError(stack_status_reason) if time.time() > time_limit: raise RuntimeError("Heat stack create timeout")