From bd5a12b0a0559bcc41c4f79d78e281ac2fefc5cc Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Thu, 29 Jan 2026 08:56:24 -0500 Subject: [PATCH] Add repository option to python content create --- CHANGES/+python-content-upload.removal | 1 + pulpcore/cli/python/content.py | 3 ++- tests/scripts/pulp_python/test_content.sh | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 CHANGES/+python-content-upload.removal diff --git a/CHANGES/+python-content-upload.removal b/CHANGES/+python-content-upload.removal new file mode 100644 index 000000000..0d5808faa --- /dev/null +++ b/CHANGES/+python-content-upload.removal @@ -0,0 +1 @@ +Deprecated `pulp python content upload` command. Use `pulp python content create` instead. diff --git a/pulpcore/cli/python/content.py b/pulpcore/cli/python/content.py index 99904a2cc..0320f25d4 100644 --- a/pulpcore/cli/python/content.py +++ b/pulpcore/cli/python/content.py @@ -142,6 +142,7 @@ def content() -> None: ), allowed_with_contexts=(PulpPythonContentContext,), ), + repository_option, ] provenance_create_options = [ package_option, @@ -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( diff --git a/tests/scripts/pulp_python/test_content.sh b/tests/scripts/pulp_python/test_content.sh index 927d10442..2d9b6ce37 100755 --- a/tests/scripts/pulp_python/test_content.sh +++ b/tests/scripts/pulp_python/test_content.sh @@ -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)"