diff --git a/heat/engine/environment.py b/heat/engine/environment.py index 995e95486b..a2162b9e45 100644 --- a/heat/engine/environment.py +++ b/heat/engine/environment.py @@ -218,7 +218,10 @@ class ResourceRegistry(object): registry[name] = info def iterable_by(self, resource_type, resource_name=None): - if resource_type.endswith(('.yaml', '.template')): + is_templ_type = resource_type.endswith(('.yaml', '.template')) + if self.global_registry is not None and is_templ_type: + # we only support dynamic resource types in user environments + # not the global environment. # resource with a Type == a template # we dynamically create an entry as it has not been registered. if resource_type not in self._registry: diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index 163b7ba37c..122c7ef904 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -432,6 +432,8 @@ class ProviderTemplateTest(HeatTestCase): {'WordPress_Single_Instance.yaml': 'WordPress_Single_Instance.yaml', 'resources': {}}, stack.env.user_env_as_dict()["resource_registry"]) + self.assertNotIn('WordPress_Single_Instance.yaml', + resources.global_env().registry._registry) def test_persisted_unregistered_provider_templates(self): """