aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-08-30 11:28:33 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-08-30 11:28:33 +0800
commita64e241ca4726582471d9428d0b7b51f3fd0b501 (patch)
treee29449fe664de502a91ac655424dc395af4a59f2
parent96adce9ff461501694dbc4ddf097b88c8695c3e8 (diff)
Modify ns get info
Issue-ID: VFC-1504 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: I9a38c21ee65f7ca86b38409fd7fdd7870d9a2652
-rw-r--r--lcm/ns/biz/ns_get.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/lcm/ns/biz/ns_get.py b/lcm/ns/biz/ns_get.py
index b406a797..83c92335 100644
--- a/lcm/ns/biz/ns_get.py
+++ b/lcm/ns/biz/ns_get.py
@@ -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