aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaibin Huang <haibin.huang@intel.com>2019-07-18 12:28:14 +0000
committerHaibin Huang <haibin.huang@intel.com>2019-07-18 12:29:23 +0000
commit947cea0fc3d11a97def32760b4df8cfc1abb7e4a (patch)
treeaab7b08f0c7b5bb30498a8f2e6fc1074203b1634
parentc0ef5491cf1d774d21377b360cc2dd4a7e6f75bc (diff)
Fix get error requirements
Issue-ID: VFC-1448 Signed-off-by: Haibin Huang <haibin.huang@intel.com> Change-Id: I574b75c4e40a3aae7a79e3d1e9804aecbe994a22
-rw-r--r--catalog/pub/utils/toscaparser/basemodel.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/catalog/pub/utils/toscaparser/basemodel.py b/catalog/pub/utils/toscaparser/basemodel.py
index 9ca9f12b..6ed26aa6 100644
--- a/catalog/pub/utils/toscaparser/basemodel.py
+++ b/catalog/pub/utils/toscaparser/basemodel.py
@@ -517,15 +517,6 @@ class BaseInfoModel(object):
if substitution_mappings:
nodeType = substitution_mappings['node_type']
logger.debug("nodeType %s", nodeType)
- if "node_types" in tosca.tpl:
- node_types = tosca.tpl['node_types'].get(nodeType, None)
- derivedFrom = node_types.get('derived_from', "")
- node['type'] = derivedFrom
- node['properties'] = node_types.get('properties', {})
- node['requirements'] = node_types.get('requirements', {})
- node['capabilities'] = node_types.get('capabilities', {})
- metadata = node_types.get('metadata', {})
-
if "type" not in node or node['type'] == "":
node['type'] = nodeType
node['properties'] = substitution_mappings.get('properties', {})
@@ -533,5 +524,11 @@ class BaseInfoModel(object):
node['capabilities'] = substitution_mappings.get('capabilities', {})
metadata = substitution_mappings.get('metadata', {})
+ if "node_types" in tosca.tpl:
+ node_types = tosca.tpl['node_types'].get(nodeType, None)
+ derivedFrom = node_types.get('derived_from', "")
+ node['type'] = derivedFrom
+ node['properties'] = node_types.get('properties', {})
+
node['metadata'] = metadata if metadata and metadata != {} else self.buildMetadata(tosca)
return node