diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2017-07-13 17:51:42 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2017-07-13 17:51:42 +0800 |
commit | e1ad31691ea4249a7dd33e9280dd6d0df8bc9475 (patch) | |
tree | 30ff99d37dedf93f3474ba3fddfcdf035ee04579 /tosca2heat/tosca-parser/toscaparser/nodetemplate.py | |
parent | 5b3f19f30ff02faa80ad02762ae23ad020b04218 (diff) |
Add getting custom node by capability
Currently _get_node_type_by_cap in nodetype definition is only concerned
standard node, not consider custom node, the patch will support to get
node by custom node.
JIRA: PARSER-126
Change-Id: I822acc8bfb747562dc084783d863adf31603e794
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/nodetemplate.py')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/nodetemplate.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/nodetemplate.py b/tosca2heat/tosca-parser/toscaparser/nodetemplate.py index ca855ad..0d65ac5 100644 --- a/tosca2heat/tosca-parser/toscaparser/nodetemplate.py +++ b/tosca2heat/tosca-parser/toscaparser/nodetemplate.py @@ -79,7 +79,9 @@ class NodeTemplate(EntityTemplate): # TODO(spzala) implement look up once Glance meta data is available # to find a matching TOSCA node using the TOSCA types msg = _('Lookup by TOSCA types is not supported. ' - 'Requirement for "%s" can not be full-filled.') % self.name + 'Requirement node "%(node)s" for "%(name)s"' + ' can not be full-filled.') \ + % {'node': node, 'name': self.name} if (node in list(self.type_definition.TOSCA_DEF.keys()) or node in self.custom_def): ExceptionCollector.appendException(NotImplementedError(msg)) @@ -87,7 +89,9 @@ class NodeTemplate(EntityTemplate): if node not in self.templates: ExceptionCollector.appendException( - KeyError(_('Node template "%s" was not found.') % node)) + KeyError(_('Node template "%(node)s" was not found' + ' in "%(name)s".') + % {'node': node, 'name': self.name})) return related_tpl = NodeTemplate(node, self.templates, self.custom_def) @@ -109,6 +113,7 @@ class NodeTemplate(EntityTemplate): break if relationship: found_relationship_tpl = False + # apply available relationship templates if found if self.available_rel_tpls: for tpl in self.available_rel_tpls: |