summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tosca_template.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2016-06-29 16:10:49 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2016-06-29 16:10:49 +0800
commit74924a61a1fefe5e4977cd8d9edf7e5bbbb9f966 (patch)
tree6966373186facb6b82bbab89058e3657040db5f6 /tosca2heat/tosca-parser/toscaparser/tosca_template.py
parent5359c6d752c29d10d8c0459f47bb7697203f1515 (diff)
netsted template validate type error
When import nested template, validate type error, in the validate list lack the type of "topology_template" Change-Id: Ic16e02f460dc59936dfc5a361a21b9533f0e5e83 JIRA: PARSER-58 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
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()