summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2018-05-22 11:59:51 +0800
committeryangyan <yangyanyj@chinamobile.com>2018-05-22 14:03:22 +0800
commit67a88b481bff73e9c6182dd9f28aaa927586f7d8 (patch)
tree67b346d3f48bfe7a69ac69be85b28fb364347de0
parent5e1e01e6342d058005e65f649d3b4c7cea513f39 (diff)
update nsd vl parse in nsdmodel
Issue-ID: VFC-918 Change-Id: I5e1d8b0a3160b94ddb72868fc53f0fdf9f22ade0 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rw-r--r--catalog/pub/utils/toscaparser/nsdmodel.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/catalog/pub/utils/toscaparser/nsdmodel.py b/catalog/pub/utils/toscaparser/nsdmodel.py
index d250559f..e1a459a2 100644
--- a/catalog/pub/utils/toscaparser/nsdmodel.py
+++ b/catalog/pub/utils/toscaparser/nsdmodel.py
@@ -141,12 +141,12 @@ class EtsiNsdInfoModel(BaseInfoModel):
def get_all_vl(self, nodeTemplates, node_types):
vls = []
for node in nodeTemplates:
- if self.isVl(node, node_types) or self._isExternalVL(node):
+ if self.isVl(node) or self._isExternalVL(node):
vl = dict()
vl['vl_id'] = node['name']
vl['description'] = node['description']
vl['properties'] = node['properties']
- vl['route_external'] = False if self.isVl(node, node_types) else True
+ vl['route_external'] = False if self.isVl(node) else True
# vl['route_id'] = self._get_vl_route_id(node)
vls.append(vl)
return vls
@@ -161,6 +161,11 @@ class EtsiNsdInfoModel(BaseInfoModel):
def _isExternalVL(self, node):
return node['nodeType'].upper().find('.ROUTEEXTERNALVL') >= 0
+ 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 get_all_cp(self, nodeTemplates, node_types):
cps = []
for node in nodeTemplates: