Commit f5c2ba9d authored by Graham Welch's avatar Graham Welch

Allow external type fetching.

parent a89b6610
...@@ -136,7 +136,7 @@ def _ProcessResource(resource, imports, env, validate_schema=False): ...@@ -136,7 +136,7 @@ def _ProcessResource(resource, imports, env, validate_schema=False):
layout = {'name': resource['name'], layout = {'name': resource['name'],
'type': resource['type']} 'type': resource['type']}
if IsTemplate(resource['type']): if IsTemplate(resource['type']) and resource['type'] in imports:
# A template resource, which contains sub-resources. # A template resource, which contains sub-resources.
expanded_template = ExpandTemplate(resource, imports, env, validate_schema) expanded_template = ExpandTemplate(resource, imports, env, validate_schema)
......
...@@ -144,12 +144,7 @@ class ExpansionTest(unittest.TestCase): ...@@ -144,12 +144,7 @@ class ExpansionTest(unittest.TestCase):
def testNoImportErrors(self): def testNoImportErrors(self):
template = 'resources: \n- type: something.jinja\n name: something' template = 'resources: \n- type: something.jinja\n name: something'
try:
expansion.Expand(template, {}) expansion.Expand(template, {})
self.fail('Expansion should fail')
except expansion.ExpansionError as e:
self.assertTrue('Unable to find source file' in e.message)
def testInvalidConfig(self): def testInvalidConfig(self):
template = ReadTestFile('invalid_config.yaml') template = ReadTestFile('invalid_config.yaml')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment