summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tosca_template.py
diff options
context:
space:
mode:
authorjulien zhang <zhang.jun3g@zte.com.cn>2016-07-08 06:06:58 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-07-08 06:06:58 +0000
commit7fe3011a67a239f7dc04153c54eaff78ef967eaf (patch)
tree029563d117ae964f06db9b05f714ed548d90d2be /tosca2heat/tosca-parser/toscaparser/tosca_template.py
parent870d910efa510e768b19785ec677ddb731c49bb0 (diff)
parent74924a61a1fefe5e4977cd8d9edf7e5bbbb9f966 (diff)
Merge "netsted template validate type error"
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tosca_template.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tosca_template.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tosca_template.py b/tosca2heat/tosca-parser/toscaparser/tosca_template.py
index 1bad6e9..2ab2581 100644
--- a/tosca2heat/tosca-parser/toscaparser/tosca_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/tosca_template.py
@@ -69,7 +69,7 @@ class ToscaTemplate(object):
self.input_path = None
self.path = None
self.tpl = None
- self.nested_tosca_template = None
+ self.nested_tosca_template = []
if path:
self.input_path = path
self.path = self._get_path(path)
@@ -199,11 +199,13 @@ class ToscaTemplate(object):
def _handle_nested_topo_tpls(self, nested_topo_tpls):
for tpl in nested_topo_tpls:
- if tpl.get(TOPOLOGY_TEMPLATE):
- nested_tosca_template = ToscaTemplate(
- path=self.path, parsed_params=self.parsed_params,
- yaml_dict_tpl=nested_topo_tpls)
- self.nested_tosca_template.apend(nested_tosca_template)
+ filename, tosca_tpl = tpl.items()[0]
+ if tosca_tpl.get(TOPOLOGY_TEMPLATE):
+ nested_template = ToscaTemplate(
+ path=filename, parsed_params=self.parsed_params,
+ yaml_dict_tpl=tosca_tpl)
+ if nested_template.topology_template.substitution_mappings:
+ self.nested_tosca_template.apend(nested_template)
def _validate_field(self):
version = self._tpl_version()