summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser
diff options
context:
space:
mode:
authorjulien zhang <zhang.jun3g@zte.com.cn>2017-08-10 03:36:48 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-10 03:36:48 +0000
commit59e3768ddbb38c31c43d9a626124b923cd0ac8d8 (patch)
treec0eb505c0f4550c3496c01a15b251c61ac9cc7bd /tosca2heat/tosca-parser
parent02a18bd6ede4fc1f8d67f3fc97a82349146a24b6 (diff)
parentaf80965fcdd0f2efb9c54714c5a0fe642ad95cb1 (diff)
Merge "Support costum datatype in capability"
Diffstat (limited to 'tosca2heat/tosca-parser')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/capabilities.py6
-rw-r--r--tosca2heat/tosca-parser/toscaparser/entity_template.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/capabilities.py b/tosca2heat/tosca-parser/toscaparser/capabilities.py
index c23ef72..1708fd8 100644
--- a/tosca2heat/tosca-parser/toscaparser/capabilities.py
+++ b/tosca2heat/tosca-parser/toscaparser/capabilities.py
@@ -16,10 +16,11 @@ from toscaparser.properties import Property
class Capability(object):
'''TOSCA built-in capabilities type.'''
- def __init__(self, name, properties, definition):
+ def __init__(self, name, properties, definition, custom_def):
self.name = name
self._properties = properties
self.definition = definition
+ self.custom_def = custom_def
def get_properties_objects(self):
'''Return a list of property objects.'''
@@ -30,7 +31,8 @@ class Capability(object):
props_def = self.definition.get_properties_def()
if props_def and name in props_def:
properties.append(Property(name, value,
- props_def[name].schema))
+ props_def[name].schema,
+ self.custom_def))
return properties
def get_properties(self):
diff --git a/tosca2heat/tosca-parser/toscaparser/entity_template.py b/tosca2heat/tosca-parser/toscaparser/entity_template.py
index cc3d620..d454ac0 100644
--- a/tosca2heat/tosca-parser/toscaparser/entity_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/entity_template.py
@@ -164,7 +164,7 @@ class EntityTemplate(object):
if 'properties' in props and props['properties']:
properties.update(props['properties'])
- cap = Capability(name, properties, c)
+ cap = Capability(name, properties, c, self.custom_def)
capability.append(cap)
return capability