X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Finfra_setup%2Fheat%2Ftemplate.py;h=98a68f7dc34c60c0c16a17a3014a3f2f5617f2a8;hb=fd7583e843493495e5e15f62b5f7d9ca484bf167;hp=cc652fb491f1ccf2785a19466374d688a36e38a3;hpb=cb7f830d3e4a2a5665ff95687838c80a353687bf;p=bottlenecks.git 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 = {}