summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2018-09-06 11:15:50 +0800
committerYan Yang <yangyanyj@chinamobile.com>2018-09-07 00:49:02 +0000
commit44ac6756720b934bf9e8bdcb2e46b7a0b7b38395 (patch)
tree7a3d78018172c81297f580a0f6b6549ece751b41
parent334833fac8351f362a525dc1c12d0096013846c8 (diff)
update get_and_check_params in lcm
Change-Id: I87cfdcfa6c53e0671f5d6f0a3eae2dc30585fc1e Issue-ID: VFC-1097 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rw-r--r--lcm/ns/biz/ns_heal.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/lcm/ns/biz/ns_heal.py b/lcm/ns/biz/ns_heal.py
index e1356785..bb0c9147 100644
--- a/lcm/ns/biz/ns_heal.py
+++ b/lcm/ns/biz/ns_heal.py
@@ -36,6 +36,7 @@ class NSHealService(threading.Thread):
self.job_id = job_id
self.heal_vnf_data = ''
+ self.heal_ns_data = ''
def run(self):
try:
@@ -59,10 +60,17 @@ class NSHealService(threading.Thread):
if not ns_info:
logger.error('NS [id=%s] does not exist' % self.ns_instance_id)
raise NSLCMException('NS [id=%s] does not exist' % self.ns_instance_id)
+ self.heal_ns_data = ignore_case_get(self.request_data, 'healNsData')
self.heal_vnf_data = ignore_case_get(self.request_data, 'healVnfData')
- if not self.heal_vnf_data:
- logger.error('healVnfData parameter does not exist or value is incorrect.')
- raise NSLCMException('healVnfData parameter does not exist or value incorrect.')
+ if self.heal_ns_data and self.heal_vnf_data:
+ logger.error('healNsData and healVnfData can not exist together')
+ raise NSLCMException('healNsData and healVnfData can not exist together')
+ if not self.heal_ns_data and not self.heal_vnf_data:
+ logger.error('healNsData and healVnfData parameters does not exist or value is incorrect.')
+ raise NSLCMException('healNsData and healVnfData parameters does not exist or value is incorrect.')
+ if self.heal_ns_data:
+ logger.info('The request of healNsData is being updated')
+ raise NSLCMException('The request of healNsData is being updated')
def do_vnfs_heal(self):
vnf_heal_params = self.prepare_vnf_heal_params(self.heal_vnf_data)