summaryrefslogtreecommitdiffstats
path: root/lcm/lcm/nf/views/curd_vnf_views.py
diff options
context:
space:
mode:
authormaopengzhang <zhang.maopeng1@zte.com.cn>2018-11-24 15:22:42 +0800
committermaopengzhang <zhang.maopeng1@zte.com.cn>2018-11-24 23:43:58 +0800
commit1f6a8972256f31809cee9514abca4215d96152bd (patch)
tree2e6212edcf672b00d5c6c27f608ea37d55fb1347 /lcm/lcm/nf/views/curd_vnf_views.py
parent1be16bee6fc098097aa28eba07ff7ab624901010 (diff)
fix VNF query result none exception
fix VNF query result none exception Change-Id: Id1266a88f400d671deea4da54908ae9a9f908d0d Issue-ID: VFC-989 Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
Diffstat (limited to 'lcm/lcm/nf/views/curd_vnf_views.py')
-rw-r--r--lcm/lcm/nf/views/curd_vnf_views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lcm/lcm/nf/views/curd_vnf_views.py b/lcm/lcm/nf/views/curd_vnf_views.py
index ae8a211a..25a98af8 100644
--- a/lcm/lcm/nf/views/curd_vnf_views.py
+++ b/lcm/lcm/nf/views/curd_vnf_views.py
@@ -42,7 +42,8 @@ class CreateVnfAndQueryVnfs(APIView):
logger.debug("QueryMultiVnf--get::> %s" % request.data)
try:
resp_data = QueryVnf(request.data).query_multi_vnf()
-
+ if len(resp_data) == 0:
+ return Response(data=[], status=status.HTTP_200_OK)
vnf_instances_serializer = VnfInstancesSerializer(data=resp_data)
if not vnf_instances_serializer.is_valid():
raise NFLCMException(vnf_instances_serializer.errors)