From 7cab4237546c6f433cd903dfec91fb4869623a84 Mon Sep 17 00:00:00 2001 From: MichalPysik Date: Mon, 27 May 2024 13:11:59 +0200 Subject: [PATCH] Stop deleting tasks after uploading manifests Tasks created after uploading manifests are no longer automatically deleted in any case. closes: #1602 --- CHANGES/1602.bugfix | 1 + pulp_container/app/utils.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 CHANGES/1602.bugfix diff --git a/CHANGES/1602.bugfix b/CHANGES/1602.bugfix new file mode 100644 index 000000000..396bb32ad --- /dev/null +++ b/CHANGES/1602.bugfix @@ -0,0 +1 @@ +Tasks created after uploading manifests will now remain available for further inspection and will not be deleted. diff --git a/pulp_container/app/utils.py b/pulp_container/app/utils.py index 4548d0930..1554a2c27 100644 --- a/pulp_container/app/utils.py +++ b/pulp_container/app/utils.py @@ -136,14 +136,11 @@ def has_task_completed(dispatched_task, wait_in_seconds=3): time.sleep(1) task = Task.objects.get(pk=dispatched_task.pk) if task.state == "completed": - task.delete() return True elif task.state in ["waiting", "running"]: continue else: - error = task.error - task.delete() - raise Exception(str(error)) + raise Exception(str(task.error)) raise Throttled()