diff options
author | 2017-09-22 10:42:29 +0000 | |
---|---|---|
committer | 2017-09-22 10:42:29 +0000 | |
commit | b16dfab8279a035ed0ce9961943c11a7e1633ea6 (patch) | |
tree | 79f0ecc6676e845f49c9417333c3c6d52884fcf9 | |
parent | b5105977d046a2448f335b6dbbf395369ed55c95 (diff) | |
parent | ab74a293bea69753b37a08e48c191173327e176a (diff) |
Merge "Remove vnf pkg force delete param"
-rw-r--r-- | catalog/packages/nf_package.py | 2 | ||||
-rw-r--r-- | catalog/packages/tests/test_nf.py | 2 | ||||
-rw-r--r-- | catalog/packages/views.py | 5 |
3 files changed, 3 insertions, 6 deletions
diff --git a/catalog/packages/nf_package.py b/catalog/packages/nf_package.py index b11288b9..f065d36f 100644 --- a/catalog/packages/nf_package.py +++ b/catalog/packages/nf_package.py @@ -151,7 +151,7 @@ class NfPkgDeleteThread(threading.Thread): Sdc NF Package Deleting """ - def __init__(self, csar_id, job_id, force_delete): + def __init__(self, csar_id, job_id): threading.Thread.__init__(self) self.csar_id = csar_id self.job_id = job_id diff --git a/catalog/packages/tests/test_nf.py b/catalog/packages/tests/test_nf.py index 4b4a86c4..8547d04d 100644 --- a/catalog/packages/tests/test_nf.py +++ b/catalog/packages/tests/test_nf.py @@ -306,7 +306,7 @@ class TestNfPackage(TestCase): def test_nf_pkg_normal_delete(self): VnfPackageModel(vnfPackageId="2", vnfdId="vcpe_vfw_zte_1_0").save() - NfPkgDeleteThread(csar_id="2", job_id="2", force_delete=False).run() + NfPkgDeleteThread(csar_id="2", job_id="2").run() self.assert_job_result("2", 100, "Delete CSAR(2) successfully.") def test_nf_pkg_get_all(self): diff --git a/catalog/packages/views.py b/catalog/packages/views.py index f0e55d92..174b2388 100644 --- a/catalog/packages/views.py +++ b/catalog/packages/views.py @@ -94,11 +94,8 @@ def nf_rd_csar(request, *args, **kwargs): ret = nf_package.nf_get_csar(csar_id) normal_status = status.HTTP_200_OK elif request.method == 'DELETE': - force_delete = csar_id.endswith("force") - if force_delete: - csar_id = csar_id[:-5] job_id = str(uuid.uuid4()) - nf_package.NfPkgDeleteThread(csar_id, job_id, force_delete).start() + nf_package.NfPkgDeleteThread(csar_id, job_id).start() ret = [0, {"jobId": job_id}] normal_status = status.HTTP_202_ACCEPTED logger.info("Leave %s, Return value is %s", fun_name(), ret) |