Modify ns get info 55/94655/1
authorhewei-cmss <hewei@cmss.chinamobile.com>
Fri, 30 Aug 2019 03:28:33 +0000 (11:28 +0800)
committerhewei-cmss <hewei@cmss.chinamobile.com>
Fri, 30 Aug 2019 03:28:33 +0000 (11:28 +0800)
Issue-ID: VFC-1504

Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
Change-Id: I9a38c21ee65f7ca86b38409fd7fdd7870d9a2652

lcm/ns/biz/ns_get.py

index b406a79..83c9233 100644 (file)
@@ -32,7 +32,6 @@ class GetNSInfoService(object):
         self.ns_filter = ns_filter
 
     def get_ns_info(self, is_sol=False):
-        ns_insts = None
         if self.ns_filter and "ns_inst_id" in self.ns_filter:
             ns_inst_id = self.ns_filter["ns_inst_id"]
             ns_insts = NSInstModel.objects.filter(id=ns_inst_id)
@@ -40,7 +39,7 @@ class GetNSInfoService(object):
             ns_insts = NSInstModel.objects.all()
         result = []
         for ns_inst in ns_insts:
-            if ns_insts and ns_insts[0].status != 'null':
+            if ns_inst.status != 'null':
                 result.append(self.get_single_ns_info(ns_inst, is_sol))
         return result