Skip to content

Commit

Permalink
Fix: ignore-not-found is not working (#138)
Browse files Browse the repository at this point in the history
* Update artifactorycleanup.py

* Update base.py
  • Loading branch information
roytev authored Mar 28, 2024
1 parent 7e5ba2a commit c894410
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion artifactory_cleanup/artifactorycleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down
1 change: 1 addition & 0 deletions artifactory_cleanup/rules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c894410

Please sign in to comment.