summaryrefslogtreecommitdiffstats
path: root/gvnfmadapter
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-23 10:08:59 +0800
committerFu Jinhua <fu.jinhua@zte.com.cn>2017-09-23 03:02:13 +0000
commit6f356efcab04329044731b186a743cd753bb8b4e (patch)
tree93c2d494380e4c2745573e7f98e27e9d649821e0 /gvnfmadapter
parentc71d5d39c51c79194e3d9b59ebfd1ac189836a4b (diff)
Fix vfc-gvnfmadapter unit tests.
Change-Id: I9bdd5829d1d005e304eda165cb0d534ecfda2bfc Issue-ID: VFC-438 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'gvnfmadapter')
-rw-r--r--gvnfmadapter/driver/interfaces/views.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py
index 04fe58e..6fb599d 100644
--- a/gvnfmadapter/driver/interfaces/views.py
+++ b/gvnfmadapter/driver/interfaces/views.py
@@ -77,9 +77,10 @@ def terminate_vnf(request, *args, **kwargs):
vnfm_id = ignorcase_get(kwargs, "vnfmid")
vnfInstanceId = ignorcase_get(kwargs, "vnfInstanceId")
try:
- input_data = {}
- input_data["terminationType"] = ignorcase_get(request.data, "terminationType")
- input_data["gracefulTerminationTimeout"] = ignorcase_get(request.data, "gracefulTerminationTimeout")
+ input_data = {
+ "terminationType": ignorcase_get(request.data, "terminationType"),
+ "gracefulTerminationTimeout": ignorcase_get(request.data, "gracefulTerminationTimeout")
+ }
logger.debug("do_terminatevnf: vnfm_id=[%s],vnfInstanceId=[%s],input_data=[%s]",
vnfm_id, vnfInstanceId, input_data)
resp = do_terminatevnf(vnfm_id, vnfInstanceId, input_data)
@@ -131,12 +132,11 @@ def query_vnf(request, *args, **kwargs):
resp_data = {
"vnfInfo":resp_response_data
}
- resp_data["vnfInfo"]["version"] = ignorcase_get(ignorcase_get(resp, "ResponseInfo"), "vnfSoftwareVersion")
- if ignorcase_get(ignorcase_get(resp, "ResponseInfo"), "instantiationState"):
- if ignorcase_get(ignorcase_get(resp, "ResponseInfo"), "instantiationState") == "INSTANTIATED":
- resp_data["vnfInfo"]["vnfStatus"] = "ACTIVE"
- if ignorcase_get(ignorcase_get(resp, "ResponseInfo"), "vnfInstanceId"):
- resp_data["vnfInfo"]["vnfInstanceId"] = ignorcase_get(ignorcase_get(resp, "ResponseInfo"), "vnfInstanceId")
+ ResponseInfo = ignorcase_get(resp, "ResponseInfo")
+ resp_data["vnfInfo"]["version"] = ignorcase_get(ResponseInfo, "vnfSoftwareVersion")
+ if ignorcase_get(ResponseInfo, "instantiationState") == "INSTANTIATED":
+ resp_data["vnfInfo"]["vnfStatus"] = "ACTIVE"
+ resp_data["vnfInfo"]["vnfInstanceId"] = ignorcase_get(ResponseInfo, "vnfInstanceId")
logger.debug("[%s]resp_data=%s", fun_name(), resp_data)
return Response(data=resp_data, status=status.HTTP_200_OK)
except GvnfmDriverException as e: