Merge "Use template directly instead of stack.tmpl"

This commit is contained in:
Jenkins 2014-12-08 02:35:52 +00:00 committed by Gerrit Code Review
commit 8c1da0bd8e
4 changed files with 7 additions and 6 deletions

View File

@ -125,8 +125,8 @@ class StackResource(resource.Resource):
parsed_child_template = child_template
if isinstance(parsed_child_template, template.Template):
parsed_child_template = parsed_child_template.t
return parser.tmpl.Template(parsed_child_template,
files=self.stack.t.files)
return template.Template(parsed_child_template,
files=self.stack.t.files)
def _parse_nested_stack(self, stack_name, child_template, child_params,
timeout_mins=None, adopt_data=None):

View File

@ -211,7 +211,7 @@ def get_wordpress_stack(stack_name, ctx):
def get_wordpress_stack_no_params(stack_name, ctx):
t = template_format.parse(wp_template)
template = parser.tmpl.Template(t)
template = templatem.Template(t)
stack = parser.Stack(ctx, stack_name, template,
environment.Environment({}))
return stack
@ -994,7 +994,7 @@ class StackServiceCreateUpdateDeleteTest(common.HeatTestCase):
s = db_api.stack_get(self.ctx, sid)
t = template_format.parse(wp_template_no_default)
template = parser.tmpl.Template(t)
template = templatem.Template(t)
env = environment.Environment({'parameters': with_params,
'resource_registry': {'rsc': 'test'}})
stack = parser.Stack(self.ctx, stack_name, template, env)

View File

@ -109,7 +109,7 @@ class StackResourceTest(common.HeatTestCase):
resource._register_class('GenericResource',
generic_rsrc.GenericResource)
self.ws_resname = "provider_resource"
t = parser.tmpl.Template(
t = templatem.Template(
{'HeatTemplateFormatVersion': '2012-12-12',
'Resources': {self.ws_resname: ws_res_snippet}})
self.parent_stack = parser.Stack(utils.dummy_context(), 'test_stack',

View File

@ -30,6 +30,7 @@ from heat.engine import resource
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.engine import stack
from heat.engine import template as templatem
from heat.tests import common
from heat.tests import utils
@ -83,7 +84,7 @@ obj_header = {
def create_stack(template, stack_id=None):
tmpl = template_format.parse(template)
template = stack.tmpl.Template(tmpl)
template = templatem.Template(tmpl)
ctx = utils.dummy_context(tenant_id='test_tenant')
st = stack.Stack(ctx, 'test_st', template,
environment.Environment(),