summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/heat/template.py
diff options
context:
space:
mode:
authorliyin <liyin11@huawei.com>2017-02-07 11:26:14 +0800
committerliyin <liyin11@huawei.com>2017-02-07 11:26:53 +0800
commitfd7583e843493495e5e15f62b5f7d9ca484bf167 (patch)
tree9a027c5497f867a48ceb7dba132714d8e62a53ec /utils/infra_setup/heat/template.py
parentcb7f830d3e4a2a5665ff95687838c80a353687bf (diff)
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 <liyin11@huawei.com>
Diffstat (limited to 'utils/infra_setup/heat/template.py')
-rwxr-xr-xutils/infra_setup/heat/template.py15
1 files changed, 12 insertions, 3 deletions
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 = {}