summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup
diff options
context:
space:
mode:
Diffstat (limited to 'utils/infra_setup')
-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 = {}