diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2017-02-26 00:49:42 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2017-02-26 00:58:41 +0800 |
commit | 406214e5ca40ad57a1c40e4a8454336f6a26cac2 (patch) | |
tree | c07fa0c0a66716351a367d1959415584fb73bab1 /tosca2heat/tosca-parser/toscaparser/elements/interfaces.py | |
parent | 0504c523da459a48721fef74216125d83a4e057d (diff) |
Sync upstream code
Sync upstream project of tosca-parser
Change-Id: Ic707844203ea05007b3c02e9dcadb52389eb3149
JIRA:PARSER-118
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/elements/interfaces.py')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/elements/interfaces.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/elements/interfaces.py b/tosca2heat/tosca-parser/toscaparser/elements/interfaces.py index 88fb8ab..47ec90a 100644 --- a/tosca2heat/tosca-parser/toscaparser/elements/interfaces.py +++ b/tosca2heat/tosca-parser/toscaparser/elements/interfaces.py @@ -22,6 +22,9 @@ SECTIONS = (LIFECYCLE, CONFIGURE, LIFECYCLE_SHORTNAME, INTERFACEVALUE = (IMPLEMENTATION, INPUTS) = ('implementation', 'inputs') +INTERFACE_DEF_RESERVED_WORDS = ['type', 'inputs', 'derived_from', 'version', + 'description'] + class InterfacesDef(StatefulEntityType): '''TOSCA built-in interfaces type.''' @@ -40,8 +43,16 @@ class InterfacesDef(StatefulEntityType): interfacetype = LIFECYCLE if interfacetype == CONFIGURE_SHORTNAME: interfacetype = CONFIGURE + if hasattr(self.ntype, 'interfaces') \ + and self.ntype.interfaces \ + and interfacetype in self.ntype.interfaces: + interfacetype = self.ntype.interfaces[interfacetype]['type'] if node_type: - self.defs = self.TOSCA_DEF[interfacetype] + if self.node_template and self.node_template.custom_def \ + and interfacetype in self.node_template.custom_def: + self.defs = self.node_template.custom_def[interfacetype] + else: + self.defs = self.TOSCA_DEF[interfacetype] if value: if isinstance(self.value, dict): for i, j in self.value.items(): |