diff options
author | julien zhang <zhang.jun3g@zte.com.cn> | 2016-05-19 08:22:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-05-19 08:22:37 +0000 |
commit | 531f79e045d0c2a35328d44d568557bdde68c543 (patch) | |
tree | 8624cfe11daafaef934f75542e132e1e32ee90ac /tosca2heat/tosca-parser | |
parent | 33d6f6274ce67bf7289afd9e7c35258f4b1cd61d (diff) | |
parent | 68cd5714afa7f4d903c2d52bbb8f2a3dc4118f61 (diff) |
Merge "bugs:The code in function of get_all_requirements is duplicated"
Diffstat (limited to 'tosca2heat/tosca-parser')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/elements/nodetype.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/elements/nodetype.py b/tosca2heat/tosca-parser/toscaparser/elements/nodetype.py index 8176def..148d2b6 100644 --- a/tosca2heat/tosca-parser/toscaparser/elements/nodetype.py +++ b/tosca2heat/tosca-parser/toscaparser/elements/nodetype.py @@ -12,7 +12,6 @@ from toscaparser.common.exception import ExceptionCollector from toscaparser.common.exception import UnknownFieldError -from toscaparser.common.exception import ValidationError from toscaparser.elements.capabilitytype import CapabilityTypeDef import toscaparser.elements.interfaces as ifaces from toscaparser.elements.interfaces import InterfacesDef @@ -160,24 +159,7 @@ class NodeType(StatefulEntityType): return self.get_value(self.REQUIREMENTS, None, True) def get_all_requirements(self): - requires = self.requirements - parent_node = self.parent_type - if requires is None: - requires = self.get_value(self.REQUIREMENTS, None, True) - if parent_node is None: - ExceptionCollector.appendException( - ValidationError(message="parent_node is " - + str(parent_node))) - else: - parent_node = parent_node.parent_type - if parent_node: - while parent_node.type != 'tosca.nodes.Root': - req = parent_node.get_value(self.REQUIREMENTS, None, True) - for r in req: - if r not in requires: - requires.append(r) - parent_node = parent_node.parent_type - return requires + return self.requirements @property def interfaces(self): |