diff options
-rw-r--r-- | catalog/pub/utils/toscaparser/basemodel.py | 8 | ||||
-rw-r--r-- | catalog/pub/utils/toscaparser/vnfdmodel.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/catalog/pub/utils/toscaparser/basemodel.py b/catalog/pub/utils/toscaparser/basemodel.py index 20a990ba..9d1ffe7a 100644 --- a/catalog/pub/utils/toscaparser/basemodel.py +++ b/catalog/pub/utils/toscaparser/basemodel.py @@ -30,8 +30,8 @@ from catalog.pub.utils.toscaparser.dataentityext import DataEntityExt logger = logging.getLogger(__name__) # TOSCA template key names -SECTIONS = (CP_TYPE) = \ - ('tosca.nodes.nfv.Cp') +SECTIONS = (VDU_TYPE, CP_TYPE) = \ + ('tosca.nodes.nfv.Vdu.Compute', 'tosca.nodes.nfv.Cp') class BaseInfoModel(object): @@ -357,8 +357,8 @@ class BaseInfoModel(object): def is_nested_ns(self, node): return node['nodeType'].upper().find('.NS.') >= 0 or node['nodeType'].upper().endswith('.NS') - def isVdu(self, node): - return node['nodeType'].upper().find('.VDU.') >= 0 or node['nodeType'].upper().endswith('.VDU') + def isVdu(self, node, node_types): + return self.isNodeTypeX(node, node_types, VDU_TYPE) def getCapabilityByName(self, node, capabilityName): if 'capabilities' in node and capabilityName in node['capabilities']: diff --git a/catalog/pub/utils/toscaparser/vnfdmodel.py b/catalog/pub/utils/toscaparser/vnfdmodel.py index f6537361..f61dfe19 100644 --- a/catalog/pub/utils/toscaparser/vnfdmodel.py +++ b/catalog/pub/utils/toscaparser/vnfdmodel.py @@ -36,7 +36,7 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel): self.image_files = self._get_all_image_file(nodeTemplates) self.local_storages = self._get_all_local_storage(nodeTemplates) self.volume_storages = self._get_all_volume_storage(nodeTemplates) - self.vdus = self._get_all_vdu(nodeTemplates) + self.vdus = self._get_all_vdu(nodeTemplates, node_types) self.vls = self.get_all_vl(nodeTemplates) self.cps = self.get_all_cp(nodeTemplates, node_types) self.plugins = self.get_all_plugin(nodeTemplates) @@ -159,10 +159,10 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel): return node['nodeType'].upper().find('.VOLUMESTORAGE.') >= 0 or node['nodeType'].upper().endswith( '.VOLUMESTORAGE') - def _get_all_vdu(self, nodeTemplates): + def _get_all_vdu(self, nodeTemplates, node_types): rets = [] for node in nodeTemplates: - if self.isVdu(node): + if self.isVdu(node, node_types): ret = {} ret['vdu_id'] = node['name'] if 'description' in node: |