summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-02-26 00:49:42 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-02-26 00:58:41 +0800
commit406214e5ca40ad57a1c40e4a8454336f6a26cac2 (patch)
treec07fa0c0a66716351a367d1959415584fb73bab1 /tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
parent0504c523da459a48721fef74216125d83a4e057d (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/entity_type.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/elements/entity_type.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py b/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
index d7fcb18..9fd6c4d 100644
--- a/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
+++ b/tosca2heat/tosca-parser/toscaparser/elements/entity_type.py
@@ -93,7 +93,7 @@ class EntityType(object):
return False
def entity_value(self, defs, key):
- if key in defs:
+ if defs and key in defs:
return defs[key]
def get_value(self, ndtype, defs=None, parent=None):
@@ -102,7 +102,7 @@ class EntityType(object):
if not hasattr(self, 'defs'):
return None
defs = self.defs
- if ndtype in defs:
+ if defs and ndtype in defs:
# copy the value to avoid that next operations add items in the
# item definitions
value = copy.copy(defs[ndtype])
@@ -110,7 +110,7 @@ class EntityType(object):
p = self
if p:
while p:
- if ndtype in p.defs:
+ if p.defs and ndtype in p.defs:
# get the parent value
parent_value = p.defs[ndtype]
if value:
@@ -159,7 +159,6 @@ class EntityType(object):
def update_definitions(version):
exttools = ExtTools()
extension_defs_file = exttools.get_defs_file(version)
-
loader = toscaparser.utils.yamlparser.load_yaml
nfv_def_file = loader(extension_defs_file)
nfv_def = {}