diff options
-rw-r--r-- | catalog/pub/utils/toscaparser/basemodel.py | 10 | ||||
-rw-r--r-- | catalog/pub/utils/toscaparser/nsdmodel.py | 6 | ||||
-rw-r--r-- | catalog/pub/utils/toscaparser/vnfdmodel.py | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/catalog/pub/utils/toscaparser/basemodel.py b/catalog/pub/utils/toscaparser/basemodel.py index 9d1ffe7a..3f1f22ef 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 = (VDU_TYPE, CP_TYPE) = \ - ('tosca.nodes.nfv.Vdu.Compute', 'tosca.nodes.nfv.Cp') +SECTIONS = (VDU_TYPE, VL_TYPE, CP_TYPE) = \ + ('tosca.nodes.nfv.Vdu.Compute', 'tosca.nodes.nfv.VnfVirtualLink', 'tosca.nodes.nfv.Cp') class BaseInfoModel(object): @@ -254,10 +254,8 @@ class BaseInfoModel(object): def isCp(self, node, node_types): return self.isNodeTypeX(node, node_types, CP_TYPE) - def isVl(self, node): - isvl = node['nodeType'].upper().find('.VIRTUALLINK.') >= 0 or node['nodeType'].upper().find('.VL.') >= 0 - isvl = isvl or node['nodeType'].upper().endswith('.VIRTUALLINK') or node['nodeType'].upper().endswith('.VL') - return isvl + def isVl(self, node, node_types): + return self.isNodeTypeX(node, node_types, VL_TYPE) def isService(self, node): return node['nodeType'].upper().find('.SERVICE.') >= 0 or node['nodeType'].upper().endswith('.SERVICE') diff --git a/catalog/pub/utils/toscaparser/nsdmodel.py b/catalog/pub/utils/toscaparser/nsdmodel.py index 37d1c117..2e679e4c 100644 --- a/catalog/pub/utils/toscaparser/nsdmodel.py +++ b/catalog/pub/utils/toscaparser/nsdmodel.py @@ -33,7 +33,7 @@ class EtsiNsdInfoModel(BaseInfoModel): node_types = tosca.topology_template.custom_defs self.vnfs = self._get_all_vnf(nodeTemplates) self.pnfs = self._get_all_pnf(nodeTemplates) - self.vls = self.get_all_vl(nodeTemplates) + self.vls = self.get_all_vl(nodeTemplates, node_types) self.cps = self.get_all_cp(nodeTemplates, node_types) self.routers = self.get_all_router(nodeTemplates) self.fps = self._get_all_fp(nodeTemplates) @@ -136,10 +136,10 @@ class EtsiNsdInfoModel(BaseInfoModel): cps.append(tmpnode) return cps - def get_all_vl(self, nodeTemplates): + def get_all_vl(self, nodeTemplates, node_types): vls = [] for node in nodeTemplates: - if self.isVl(node): + if self.isVl(node, node_types): vl = {} vl['vl_id'] = node['name'] vl['description'] = node['description'] diff --git a/catalog/pub/utils/toscaparser/vnfdmodel.py b/catalog/pub/utils/toscaparser/vnfdmodel.py index f61dfe19..fbed8b98 100644 --- a/catalog/pub/utils/toscaparser/vnfdmodel.py +++ b/catalog/pub/utils/toscaparser/vnfdmodel.py @@ -37,7 +37,7 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel): 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, node_types) - self.vls = self.get_all_vl(nodeTemplates) + self.vls = self.get_all_vl(nodeTemplates, node_types) self.cps = self.get_all_cp(nodeTemplates, node_types) self.plugins = self.get_all_plugin(nodeTemplates) self.routers = self.get_all_router(nodeTemplates) |