From fd7583e843493495e5e15f62b5f7d9ca484bf167 Mon Sep 17 00:00:00 2001 From: liyin Date: Tue, 7 Feb 2017 11:26:14 +0800 Subject: Bottlenecks stack config parser. JIRA:BOTTLENECK-126 realize the function of parsering stack config. include the function all the jira mationed. it's important for stack creating. this patch also include manager.py. This file modify some file such like template intial. Change-Id: Iaa6fdbde6bf9cb1ff9875d47268440dfe70ecc49 Signed-off-by: liyin --- utils/infra_setup/heat/template.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'utils/infra_setup') diff --git a/utils/infra_setup/heat/template.py b/utils/infra_setup/heat/template.py index cc652fb4..98a68f7d 100755 --- a/utils/infra_setup/heat/template.py +++ b/utils/infra_setup/heat/template.py @@ -7,7 +7,9 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -"""Heat template and stack management""" +"""Heat template and stack management, +This file could manage stack include the function: +create stack delete stack and so on""" import time import sys @@ -131,7 +133,11 @@ class HeatStack(HeatObject): class HeatTemplate(HeatObject): '''Describes a Heat template and a method to deploy template to a stack''' - def __init__(self, name, template_file=None, heat_parameters=None): + def __init__(self, + name, + template_file=None, + heat_parameters=None, + heat_template=None): super(HeatTemplate, self).__init__() self.name = name self.state = "NOT_CREATED" @@ -151,7 +157,10 @@ class HeatTemplate(HeatObject): self._template = template_str self._parameters = heat_parameters else: - sys.exit("\nno such template file.") + if heat_template: + self._template = heat_template + else: + sys.exit("can't init template file!") # holds results of requested output after deployment self.outputs = {} -- cgit 1.2.3-korg