Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+python-content-upload.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecated `pulp python content upload` command. Use `pulp python content create` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the other way around?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a create generic and not an upload generic. But I'm open to either, they both ultimately call the same code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the generic and overwrite it's name?
I think "upload" is the more intuitive when you have a file on disk. ... oh hold on. Create can also accept a url to down load, right? In fact "create" even is the more generic name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the PulpContentContext the upload function is deprecated according to the comment and it says to use the create call, so just reusing same logic for the commands.

3 changes: 2 additions & 1 deletion pulpcore/cli/python/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def content() -> None:
),
allowed_with_contexts=(PulpPythonContentContext,),
),
repository_option,
]
provenance_create_options = [
package_option,
Expand Down Expand Up @@ -202,7 +203,7 @@ def upload(
attestations: list[t.Any] | None,
repository: PulpPythonRepositoryContext | None,
) -> None:
"""Create a Python package content unit through uploading a file"""
"""Create a Python package content unit through uploading a file [deprecated]"""
assert isinstance(entity_ctx, PulpPythonContentContext)

result = entity_ctx.upload(
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sha256=$(sha256sum "shelf-reader-0.1.tar.gz" | cut -d' ' -f1)

expect_succ pulp python repository create --name "cli_test_python_upload_repository"
expect_succ pulp python content upload --file "shelf-reader-0.1.tar.gz" --relative-path "shelf-reader-0.1.tar.gz" --repository "cli_test_python_upload_repository"
expect_succ pulp python content create --file "shelf-reader-0.1.tar.gz" --relative-path "shelf-reader-0.1.tar.gz" --repository "cli_test_python_upload_repository"
expect_succ pulp artifact list --sha256 "$sha256"
expect_succ pulp python content list --filename "shelf-reader-0.1.tar.gz"
content_href="$(echo "$OUTPUT" | tr '\r\n' ' ' | jq -r .[0].pulp_href)"
Expand Down
Loading