aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2017-09-22 18:33:45 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2017-09-22 18:33:45 +0800
commitab74a293bea69753b37a08e48c191173327e176a (patch)
tree291eec5a5773d29fb6e2a0557400905d99c88492
parent039b5ff1e250ba1a8ebe4d35b7c0a69b3fb3952e (diff)
Remove vnf pkg force delete param
Change-Id: I9fac756059fbeab427c95c01214f6cf3f5ee7612 Issue--Id: VFC-432 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--catalog/packages/nf_package.py2
-rw-r--r--catalog/packages/tests/test_nf.py2
-rw-r--r--catalog/packages/views.py5
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)