summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog/pub/utils/toscaparser/basemodel.py2
-rw-r--r--catalog/pub/utils/toscaparser/nsdmodel.py9
-rw-r--r--tox.ini2
3 files changed, 9 insertions, 4 deletions
diff --git a/catalog/pub/utils/toscaparser/basemodel.py b/catalog/pub/utils/toscaparser/basemodel.py
index 1b28b598..83d17ee3 100644
--- a/catalog/pub/utils/toscaparser/basemodel.py
+++ b/catalog/pub/utils/toscaparser/basemodel.py
@@ -153,7 +153,7 @@ class BaseInfoModel(object):
def buidMetadata(self, tosca):
if 'metadata' in tosca.tpl:
self.metadata = copy.deepcopy(tosca.tpl['metadata'])
- self.metadata['id'] = tosca.tpl['metadata']['invariantUUID']
+ self.metadata['id'] = tosca.tpl['metadata']['UUID']
def buildProperties(self, nodeTemplate, parsed_params):
properties = {}
diff --git a/catalog/pub/utils/toscaparser/nsdmodel.py b/catalog/pub/utils/toscaparser/nsdmodel.py
index 46162326..47a05f09 100644
--- a/catalog/pub/utils/toscaparser/nsdmodel.py
+++ b/catalog/pub/utils/toscaparser/nsdmodel.py
@@ -63,6 +63,10 @@ class EtsiNsdInfoModel(BaseInfoModel):
ret['description'] = nodeTemplate.entity_tpl['description']
else:
ret['description'] = ''
+ if 'metadata' in nodeTemplate.entity_tpl:
+ ret['metadata'] = nodeTemplate.entity_tpl['metadata']
+ else:
+ ret['metadata'] = ''
props = self.buildProperties(nodeTemplate, parsed_params)
ret['properties'] = self.verify_properties(props, inputs, parsed_params)
ret['requirements'] = self.build_requirements(nodeTemplate)
@@ -81,11 +85,12 @@ class EtsiNsdInfoModel(BaseInfoModel):
vnf['vnf_id'] = node['name']
vnf['description'] = node['description']
vnf['properties'] = node['properties']
+ vnf['properties']['id'] = node['metadata'].get('UUID', 'undefined')
for key in vnf['properties'].iterkeys():
if key.endswith('_version'):
vnf['properties'].update(version=vnf['properties'].pop(key))
- if key.endswith('_id'):
- vnf['properties'].update(id=vnf['properties'].pop(key))
+ # if key.endswith('_id'):
+ # vnf['properties'].update(id=vnf['properties'].pop(key))
if key.endswith('_csarProvider'):
vnf['properties'].update(csarProvider=vnf['properties'].pop(key))
if key.endswith('_csarVersion'):
diff --git a/tox.ini b/tox.ini
index a45ee898..7facc7ce 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,7 +6,7 @@ skipsdist = true
downloadcache = ~/cache/pip
[flake8]
-ignore = E501
+ignore = E501,E722
exclude = ./venv-tox,./.tox
[testenv]