summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/elements
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2016-06-15 23:24:44 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2016-06-15 23:24:44 +0800
commit6b4ad25ad60a6e7f508142fe7e0656da349eb556 (patch)
treec6741a17ab8cdaf83555318495bff62c5b2e0e8a /tosca2heat/tosca-parser/toscaparser/elements
parent37c637988622dde3425390fb861800ffdaf2b6cb (diff)
Incorrect inheritance of requirements in NodeType
1. When define a new NodeType that inherits from a normative type that has some requirements, and if the reqirement item name is same as parent's, there will be duplicated requirements, not override the parent's item. 2. The bug will submit to openstack community. Change-Id: I22f6e723179a8a8c334d37c1a69b7039dc1f6ae7 JIRA: PARSER-56 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/elements')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/elements/entity_type.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py b/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
index 5d620a5..72e7e3f 100644
--- a/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
+++ b/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
@@ -106,8 +106,13 @@ class EntityType(object):
value[k] = v
if isinstance(value, list):
for p_value in parent_value:
- if p_value not in value:
- value.append(p_value)
+ if isinstance(p_value, dict):
+ if p_value.keys()[0] not in [
+ item.keys()[0] for item in value]:
+ value.append(p_value)
+ else:
+ if p_value not in value:
+ value.append(p_value)
else:
value = copy.copy(parent_value)
p = p.parent_type