diff --git a/artifactory_cleanup/artifactorycleanup.py b/artifactory_cleanup/artifactorycleanup.py index 927e3d5..68615fd 100644 --- a/artifactory_cleanup/artifactorycleanup.py +++ b/artifactory_cleanup/artifactorycleanup.py @@ -58,7 +58,7 @@ def cleanup(self, block_ctx_mgr, test_ctx_mgr) -> Iterator[CleanupSummary]: # Delete artifacts for artifact in artifacts_to_remove: with test_ctx_mgr(get_name_for_ci(artifact)): - policy.delete(artifact, destroy=self.destroy) + policy.delete(artifact, destroy=self.destroy, ignore_not_found=self.ignore_not_found) # Show summary print(f"Deleted artifacts count: {len(artifacts_to_remove)}") diff --git a/artifactory_cleanup/rules/base.py b/artifactory_cleanup/rules/base.py index 02e2270..36916be 100644 --- a/artifactory_cleanup/rules/base.py +++ b/artifactory_cleanup/rules/base.py @@ -321,5 +321,6 @@ def delete(self, artifact: ArtifactDict, destroy: bool, ignore_not_found: bool = except HTTPError as e: if e.response.status_code == 404 and ignore_not_found: print(f"NOT FOUND - '{artifact_path}' was not found, so not deleted.") + return raise