summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/entity_template.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2016-06-14 15:28:35 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2016-06-16 20:13:19 +0800
commit898719f261d68f822e3ab14c1466e893dd70f2a7 (patch)
tree6d59c78fe6ed569021d71c5d390d1af8f2e868b5 /tosca2heat/tosca-parser/toscaparser/entity_template.py
parent37c637988622dde3425390fb861800ffdaf2b6cb (diff)
EntityTemplate has no property of parent_type
1. EntityTemplate is the parent of NodeTemplate,but there is no definition of parent_type definition, so the method of is_derived_from will be error when call the parent_type's method. 2. The bug will submit to openstack community. Change-Id: If6d360932fd610f001934d23aac63e11ac16fddf JIRA: PARSER-51 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/entity_template.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/entity_template.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/entity_template.py b/tosca2heat/tosca-parser/toscaparser/entity_template.py
index 281012b..f416c99 100644
--- a/tosca2heat/tosca-parser/toscaparser/entity_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/entity_template.py
@@ -81,6 +81,15 @@ class EntityTemplate(object):
def type(self):
if self.type_definition:
return self.type_definition.type
+ else:
+ return None
+
+ @property
+ def parent_type(self):
+ if self.type_definition:
+ return self.type_definition.parent_type
+ else:
+ return None
@property
def requirements(self):