fix VNF query result none exception
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / biz / query_vnf.py
index c735e0b..1dd7c2d 100644 (file)
@@ -35,11 +35,12 @@ class QueryVnf:
 
     def query_multi_vnf(self):
         vnf_insts = NfInstModel.objects.all()
-        if not vnf_insts:
-            raise NFLCMException('VnfInsts does not exist.')
+        if not vnf_insts:
+        #    raise NFLCMException('VnfInsts does not exist.')
         resp_data = []
-        for vnf_inst in vnf_insts:
-            resp_data.append(self.fill_resp_data(vnf_inst))
+        if vnf_insts:
+            for vnf_inst in vnf_insts:
+                resp_data.append(self.fill_resp_data(vnf_inst))
         return resp_data
 
     def fill_resp_data(self, vnf):