diff options
author | biancunkang <bian.cunkang@zte.com.cn> | 2018-08-15 10:48:52 +0800 |
---|---|---|
committer | biancunkang <bian.cunkang@zte.com.cn> | 2018-08-15 10:48:52 +0800 |
commit | 9d6a6df4c4459cac0b6ca0b0390c6dc2a708d707 (patch) | |
tree | 679fab55e1ebc2cf0e74b986f2d05bd41d18eafc | |
parent | a137816c1365e2b92590051243b51c1606fec879 (diff) |
Change in gvnfm
Modify VnfTermInfo
Change-Id: Ib8da4f32e5ac896467f70ed0a35173d08b2f4353
Issue-ID: VFC-1015
Signed-off-by: biancunkang <bian.cunkang@zte.com.cn>
-rw-r--r-- | gvnfmadapter/driver/interfaces/tests.py | 5 | ||||
-rw-r--r-- | gvnfmadapter/driver/interfaces/views.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gvnfmadapter/driver/interfaces/tests.py b/gvnfmadapter/driver/interfaces/tests.py index 29cb918..9dece6a 100644 --- a/gvnfmadapter/driver/interfaces/tests.py +++ b/gvnfmadapter/driver/interfaces/tests.py @@ -119,10 +119,11 @@ class InterfacesTest(TestCase): r1 = [0, json.JSONEncoder().encode(vnfm_info), "200"] r2 = [0, json.JSONEncoder().encode(job_info), "200"] job_ret = [0, json.JSONEncoder().encode(job_status_info), "200"] - mock_call_req.side_effect = [r1, r2, r1, job_ret, r1, r2] + r3 = [0, json.JSONEncoder().encode(None), "200"] + mock_call_req.side_effect = [r1, r2, r1, job_ret, r1, r3] response = self.client.post("/api/gvnfmdriver/v1/ztevnfmid/vnfs/2/terminate") self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code) - self.assertEqual(job_info, response.data) + self.assertEqual(None, response.data) @mock.patch.object(restcall, 'call_req') def test_query_vnf(self, mock_call_req): diff --git a/gvnfmadapter/driver/interfaces/views.py b/gvnfmadapter/driver/interfaces/views.py index 50e8d36..b2eab99 100644 --- a/gvnfmadapter/driver/interfaces/views.py +++ b/gvnfmadapter/driver/interfaces/views.py @@ -115,7 +115,7 @@ class VnfTermInfo(APIView): resp = do_terminatevnf(vnfm_id, vnfInstanceId, input_data) logger.debug("terminate_vnf: response data=[%s]", resp) - jobId = ignorcase_get(resp, "vnfLcOpId") + jobId = ignorcase_get(resp, "jobId") gracefulTerminationTimeout = ignorcase_get(request.data, "gracefulTerminationTimeout") logger.debug("wait4job: vnfm_id=[%s],jobId=[%s],gracefulTerminationTimeout=[%s]", vnfm_id, jobId, gracefulTerminationTimeout) |