aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/orchestrator/heat.py
diff options
context:
space:
mode:
authorHans Feldt <hans.feldt@ericsson.com>2015-06-05 10:17:01 +0200
committerHans Feldt <hans.feldt@ericsson.com>2015-06-09 13:05:12 +0000
commitadf4a310ea7138866e77b0759a07042daac0cca7 (patch)
tree682d385c85622a73aa0a1a25ba37d52e6a61c9bd /yardstick/orchestrator/heat.py
parent508e01d81a96c8ede773e6d0dd332892e9600ea7 (diff)
Add support for multiple contexts(stacks)
A list of contexts can be specified, cross referencing between contexts is supported and shown in the added sample file. TBD can placement group work between stacks? Change-Id: I26dbe94e52ba0be5e49f50fd70540a57de2204cb JIRA: YARDSTICK-31 Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
Diffstat (limited to 'yardstick/orchestrator/heat.py')
-rw-r--r--yardstick/orchestrator/heat.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index 9c0d0f1a4..ddab89640 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -66,9 +66,9 @@ class HeatStack(HeatObject):
''' Represents a Heat stack (deployed template) '''
stacks = []
- def __init__(self, uuid, name):
+ def __init__(self, name):
super(HeatStack, self).__init__()
- self.uuid = uuid
+ self.uuid = None
self.name = name
self.outputs = None
HeatStack.stacks.append(self)
@@ -80,6 +80,9 @@ class HeatStack(HeatObject):
def _delete(self):
'''deletes a stack from the target cloud using heat'''
+ if self.uuid is None:
+ return
+
log.info("Deleting stack '%s', uuid:%s", self.name, self.uuid)
heat = self._get_heat_client()
template = heat.stacks.get(self.uuid)
@@ -131,7 +134,7 @@ class HeatStack(HeatObject):
@staticmethod
def delete_all():
- for stack in HeatStack.stacks:
+ for stack in HeatStack.stacks[:]:
stack.delete()
def update(self):
@@ -394,14 +397,14 @@ class HeatTemplate(HeatObject):
returns a dict with the requested output values from the template'''
log.info("Creating stack '%s'", self.name)
+ # create stack early to support cleanup, e.g. ctrl-c while waiting
+ stack = HeatStack(self.name)
+
heat = self._get_heat_client()
json_template = json.dumps(self._template)
start_time = time.time()
- self.uuid = heat.stacks.create(stack_name=self.name,
- template=json_template)['stack']['id']
-
- # create stack early to support cleanup, e.g. ctrl-c while waiting
- stack = HeatStack(self.uuid, self.name)
+ stack.uuid = self.uuid = heat.stacks.create(
+ stack_name=self.name, template=json_template)['stack']['id']
status = self.status()