Project

Profile

Help

Issue #7319

closed

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

Added by daviddavis over 4 years ago. Updated about 4 years 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

Actions #1

Updated by fao89 over 4 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 79
Actions #2

Updated by rchan over 4 years ago

  • Sprint changed from Sprint 79 to Sprint 80
Actions #3

Updated by fao89 over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #4

Updated by pulpbot over 4 years ago

  • Status changed from ASSIGNED to POST

Added by Fabricio Aguiar over 4 years ago

Revision 5c776223 | View on GitHub

Fixed: PulpTemporaryFile stored in the wrong location

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

Actions #5

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by bmbouter about 4 years ago

  • Sprint/Milestone set to 3.7.0
Actions #8

Updated by pulpbot about 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF