Fix user provider template registration

Trying to use an external template as a resource fails in obscure path
in the environment because TemplateResourceInfo value is not required.
Enforcing a value (with the template path) fixes the issue.

Change-Id: Ib92bc0827e9a94a3735493eb47cd227449552990
Closes-Bug: #1288541
This commit is contained in:
Thomas Herve 2014-03-12 15:12:54 +01:00
parent 96f427b592
commit 0649a00e66
2 changed files with 5 additions and 0 deletions

View File

@ -111,6 +111,7 @@ class TemplateResourceInfo(ResourceInfo):
self.template_name = self.name
else:
self.template_name = value
self.value = self.template_name
def get_class(self):
from heat.engine.resources import template_resource

View File

@ -428,6 +428,10 @@ class ProviderTemplateTest(HeatTestCase):
self.assertIn(attrib, templ_resource.attributes)
for k, v in json_snippet.get("Properties").items():
self.assertEqual(v, templ_resource.properties[k])
self.assertEqual(
{'WordPress_Single_Instance.yaml':
'WordPress_Single_Instance.yaml', 'resources': {}},
stack.env.user_env_as_dict()["resource_registry"])
def test_persisted_unregistered_provider_templates(self):
"""