Issue #4293
closedContent delivery fails if downloaded Artifact happens to exist.
Description
Currently, the content app fails to save an association between a content unit and a downloaded artifact if the artifact happens to already exists in the database.
This may happen if multiple content instances share the same artifact or if the content type does not
have enough metadata to ensure uniqueness without downloading the actual artifact (i.e. no digest in metadata).
Fix this by get()
ting the existing Artifact if saving it fails.
Additionally, move the saving code into a method of its own to allow derived content handlers to implement additional checks/saving steps.
Added by gmbnomis almost 6 years ago
Added by gmbnomis almost 6 years ago
Revision 7de35c4c | View on GitHub
Improve Artifact generation and saving for content app
-
Refactor Artifact generation for "on_demand" policy into method of its own. This allows derived plugin content handlers to customize the saving part.
-
Don't fail if the Artifact already exists. This may happen if multiple content instances share the same artifact or if the content type does not have enough metadata to ensure uniqueness without downloading the actual artifact (i.e. no digest in metadata).
Updated by gmbnomis almost 6 years ago
Updated by CodeHeeler almost 6 years ago
- Status changed from NEW to POST
- Triaged changed from No to Yes
Updated by gmbnomis almost 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|7de35c4c242cf63c6928fa28631b008b0c67e6a0.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Improve Artifact generation and saving for content app
Refactor Artifact generation for "on_demand" policy into method of its own. This allows derived plugin content handlers to customize the saving part.
Don't fail if the Artifact already exists. This may happen if multiple content instances share the same artifact or if the content type does not have enough metadata to ensure uniqueness without downloading the actual artifact (i.e. no digest in metadata).
fixes #4293 https://pulp.plan.io/issues/4293