Project

Profile

Help

Issue #4272

ArtifactFileField's validation is too strict

Added by dkliban@redhat.com 10 months ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

ArtifactFileField validates that the file being saved does not already exist in Artifact storage0. However, when bulk_get_or_create encounters a problem during bulk_create, it already moves the file into place before falling back to saving each model individually1. As a result, the validation logic from ArtifactFileField throws a ValueError because the file is already in Artifact storage, however it is still not saved to the database.

The validation should allow the file to be already in Artifact storage as long as it's being "saved" to the exact same location as it is at already.

[0] https://github.com/pulp/pulp/blob/master/pulpcore/app/models/fields.py#L31
[1] https://github.com/pulp/pulp/blob/master/pulpcore/app/models/content.py#L46

Associated revisions

Revision a73e29d0 View on GitHub
Added by mdellweg 10 months ago

Do not fail if file already moved to storage

https://pulp.plan.io/issues/4272
closes #4272

Revision a73e29d0 View on GitHub
Added by mdellweg 10 months ago

Do not fail if file already moved to storage

https://pulp.plan.io/issues/4272
closes #4272

History

#1 Updated by dkliban@redhat.com 10 months ago

  • Tags Pulp 3 added

#2 Updated by mdellweg 10 months ago

  • Status changed from NEW to MODIFIED

#3 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#4 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF