Project

Profile

Help

Issue #3425

closed

Path on content unit doesn't seem to do anything

Added by daviddavis about 6 years ago. Updated about 4 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

When you create a content unit:

https://github.com/pulp/pulp_file#create-file-content-from-an-artifact

You set the relative_path via the artifacts dict on the ContentArtifact here:

https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/viewsets/content.py#L57-L59

See the model here:

https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/models/content.py#L139

This relative_path field is what the publishing code uses:

https://git.io/vAHHJ

As well as the manifest code:

https://git.io/vAHHU

AFAICT, the path field on FileContent isn't used at all.


Related issues

Related to File Support - Issue #3410: Rename content field "path" to "relative_path"CLOSED - CURRENTRELEASEdaviddavisActions
Is duplicate of File Support - Task #3428: Update content unit creation so it takes only a relative_path and artifact hrefCLOSED - CURRENTRELEASEdaviddavis

Actions
Actions #1

Updated by daviddavis about 6 years ago

  • Related to Issue #3410: Rename content field "path" to "relative_path" added
Actions #2

Updated by daviddavis about 6 years ago

  • Description updated (diff)
Actions #3

Updated by daviddavis about 6 years ago

  • Description updated (diff)
Actions #4

Updated by daviddavis about 6 years ago

To further illustrate this, suppose I upload file test.tar.gz and then create a content unit with:

{
  "digest": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
  "path": "foo.tar.gz",
  "artifacts": {"bar.tar.gz":"http://localhost:8000/api/v3/artifacts/7d39e3f6-535a-4b6e-81e9-c83aa56aa19e/"}
}

The publishing code serves this unit at the ContentArtifact.relative_path of bar.tar.gz.

Actions #5

Updated by jortel@redhat.com about 6 years ago

The path is part of the FileContent natural key (unit key) and supports uniqueness.

Actions #6

Updated by daviddavis about 6 years ago

  • Status changed from NEW to CLOSED - DUPLICATE
Actions #7

Updated by daviddavis about 6 years ago

  • Is duplicate of Task #3428: Update content unit creation so it takes only a relative_path and artifact href added

Also available in: Atom PDF