Project

Profile

Help

Refactor #3113

closed

Update Artifact instantiation code to use paths to files

Added by dkliban@redhat.com about 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 28
Quarter:

Description

The Artifact model can be instantiated using an open file or a path to a file on disk. The code in the ChangeSet needs to be updated to stop opening files before instantiating the Artifact. Both of the importers in the example plugin currently open a file before instantiating an Artifact. Both importers need to stop doing this and simply pass in a path to the file when instantiating an Artifact.

The ArtifactFileFiled needs to be updated to open the file in binary mode[0].

[0] https://github.com/pulp/pulp/blob/15857fb0831c0998219a32e8d6ba52abdba20888/platform/pulpcore/app/models/fields.py#L26

Also available in: Atom PDF