diff options
author | fengyuanxing <feng.yuanxing@zte.com.cn> | 2017-09-01 11:11:14 +0800 |
---|---|---|
committer | fengyuanxing <feng.yuanxing@zte.com.cn> | 2017-09-01 11:11:14 +0800 |
commit | 3a772d431e121dd03dd663eadc099c38557edb75 (patch) | |
tree | fc8d1b999b95cf01d4fc134fa6edd51169959996 | |
parent | 81d1c0ca2a9fdb55487bfd921e769aed03517de8 (diff) |
Rename method of delete ns/nf
Change-Id: I5eabb08d046a36ffb1537c78a70006b5bbdb50a2
Issue-Id: VFC-214
Signed-off-by: fengyuanxing <feng.yuanxing@zte.com.cn>
-rw-r--r-- | catalog/packages/nf_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/ns_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/tests.py | 8 | ||||
-rw-r--r-- | catalog/pub/msapi/nfvolcm.py | 4 |
4 files changed, 6 insertions, 10 deletions
diff --git a/catalog/packages/nf_package.py b/catalog/packages/nf_package.py index c3d2e7d9..4626506d 100644 --- a/catalog/packages/nf_package.py +++ b/catalog/packages/nf_package.py @@ -178,7 +178,7 @@ class NfPkgDeleteThread(threading.Thread): if NfInstModel.objects.filter(package_id=self.csar_id): raise NSLCMException("NfInst by csar(%s) exists, cannot delete." % self.csar_id) ''' - nfvolcm.delete_ns_mock() + nfvolcm.delete_nf_inst_mock() JobUtil.add_job_status(self.job_id, 50, "Delete CSAR(%s) from Database." % self.csar_id) NfPackageModel.objects.filter(nfpackageid=self.csar_id).delete() diff --git a/catalog/packages/ns_package.py b/catalog/packages/ns_package.py index 683b0548..29113d08 100644 --- a/catalog/packages/ns_package.py +++ b/catalog/packages/ns_package.py @@ -141,7 +141,7 @@ class NsPackage(object): if NSInstModel.objects.filter(nspackage_id=csar_id): raise NSLCMException("CSAR(%s) is in using, cannot be deleted." % csar_id) ''' - nfvolcm.delete_ns_mock() + nfvolcm.delete_ns_inst_mock() NSDModel.objects.filter(id=csar_id).delete() return [0, "Delete CSAR(%s) successfully." % csar_id] diff --git a/catalog/packages/tests.py b/catalog/packages/tests.py index 75167f24..d5202757 100644 --- a/catalog/packages/tests.py +++ b/catalog/packages/tests.py @@ -502,10 +502,8 @@ class PackageTest(unittest.TestCase): def test_nf_package_delete_error(self): # Delete it directly - - #response = self.client.delete("/api/catalog/v1/vnfpackages/" + str(self.nf_csarId)) - #self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content) - pass + NfPkgDeleteThread("bb", "6", False).run() + self.assert_nfmodel_result("bb",0) @mock.patch.object(NfDistributeThread, 'get_vnfd') def test_nf_package_delete(self,mock_get_vnfd): @@ -522,8 +520,6 @@ class PackageTest(unittest.TestCase): NfPkgDeleteThread("bb", "6", False).run() self.assert_nfmodel_result("bb",0) - - def assert_job_result(self, job_id, job_progress, job_detail): jobs = JobStatusModel.objects.filter( jobid=job_id, diff --git a/catalog/pub/msapi/nfvolcm.py b/catalog/pub/msapi/nfvolcm.py index 07665bf0..e25430ec 100644 --- a/catalog/pub/msapi/nfvolcm.py +++ b/catalog/pub/msapi/nfvolcm.py @@ -34,11 +34,11 @@ def call_lcm(resource, method, content=''): content=content) # Mock code because the REST API from nfvolcm to delete ns instance is not implemented -def delete_ns_mock(): +def delete_ns_inst_mock(): return [0,'success'] # Mock code because the REST API from nfvolcm to delete nf instance is not implemented -def delete_nf_mock(): +def delete_nf_inst_mock(): return [0,'success'] def delete_ns(asset_type): |