Project

Profile

Help

Issue #7319

PulpTemporaryFile aren't being stored in /var/lib/pulp

Added by daviddavis 2 months ago. Updated 28 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 80
Quarter:

Description

We intended for these files to be stored in /var/lib/pulp[0].

In [1]: import tempfile                                                                                               

In [2]: with tempfile.NamedTemporaryFile("ab") as tf: 
   ...:     temp_file = PulpTemporaryFile(file=tf.name) 
   ...:     temp_file.save() 
   ...:                                                                                                               

In [3]: PulpTemporaryFile.objects.all()                                                                               
Out[3]: <QuerySet [<PulpTemporaryFile: pk=db5b57ba-1f65-4f0c-85b5-6d01c84b7d77>]>

In [4]: PulpTemporaryFile.objects.all()[0].file                                                                       
Out[4]: <FieldFile: /tmp/tmp7ttftw60>

In [5]: PulpTemporaryFile.objects.all()[0].file.read()
OSError: File does not exist: tmp/tmp7ttftw60

I think if we use ArtifactFileField[1], it should resolve this problem.

[0] https://github.com/pulp/pulpcore/blob/0f30cfefdfedc53cf79dc6ce9d12ff9e33351e96/pulpcore/app/models/content.py#L290-L298 [1] https://github.com/pulp/pulpcore/blob/b94abd64d76ea4554e6750ff38ce458eaa888cc8/pulpcore/app/models/fields.py#L11

Associated revisions

Revision 5c776223 View on GitHub
Added by Fabricio Aguiar about 2 months ago

Fixed: PulpTemporaryFile stored in the wrong location

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

History

#1 Updated by fao89 2 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 79

#2 Updated by rchan about 2 months ago

  • Sprint changed from Sprint 79 to Sprint 80

#3 Updated by fao89 about 2 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#4 Updated by pulpbot about 2 months ago

  • Status changed from ASSIGNED to POST

#5 Updated by Anonymous about 2 months ago

  • Status changed from POST to MODIFIED

#7 Updated by bmbouter 28 days ago

  • Sprint/Milestone set to 3.7.0

#8 Updated by pulpbot 28 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF