From: hewei-cmss Date: Fri, 30 Aug 2019 03:28:33 +0000 (+0800) Subject: Modify ns get info X-Git-Tag: 1.3.7~52 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F94655%2F1;p=vfc%2Fnfvo%2Flcm.git Modify ns get info Issue-ID: VFC-1504 Signed-off-by: hewei-cmss Change-Id: I9a38c21ee65f7ca86b38409fd7fdd7870d9a2652 --- 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