summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-07-16 16:11:38 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-07-16 16:11:38 +0800
commit563ecf2c65bfa943890b63ae2f0e95c3a5908dee (patch)
tree64cabb34cd990bc9694273f742a3e89692c36a4c
parente21d3e267140135cc7124a7cfce336e55a2d44b9 (diff)
Fix get ns
Status should be null after terminated NS. Issue-ID: VFC-1447 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: Ifbaeb97f759c67dafc8747760d24c0bf2c3498cf
-rw-r--r--lcm/ns/biz/ns_get.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lcm/ns/biz/ns_get.py b/lcm/ns/biz/ns_get.py
index e023a1b1..b406a797 100644
--- a/lcm/ns/biz/ns_get.py
+++ b/lcm/ns/biz/ns_get.py
@@ -38,7 +38,11 @@ class GetNSInfoService(object):
ns_insts = NSInstModel.objects.filter(id=ns_inst_id)
else:
ns_insts = NSInstModel.objects.all()
- return [self.get_single_ns_info(ns_inst, is_sol) for ns_inst in ns_insts]
+ result = []
+ for ns_inst in ns_insts:
+ if ns_insts and ns_insts[0].status != 'null':
+ result.append(self.get_single_ns_info(ns_inst, is_sol))
+ return result
def get_single_ns_info(self, ns_inst, is_sol=False):
if is_sol: