From a481737b0403ed6aea4535338f75201e44d1ca51 Mon Sep 17 00:00:00 2001 From: Balasankar 'Balu' C Date: Thu, 11 Dec 2025 10:09:45 +0530 Subject: [PATCH] rpm: Skip explicit publishing after package upload if repo has autopublish enabled closes #1284 Signed-off-by: Balasankar 'Balu' C --- CHANGES/1284.bugfix | 1 + pulpcore/cli/rpm/content.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 CHANGES/1284.bugfix diff --git a/CHANGES/1284.bugfix b/CHANGES/1284.bugfix new file mode 100644 index 00000000..b992e316 --- /dev/null +++ b/CHANGES/1284.bugfix @@ -0,0 +1 @@ +Fix CLI explicitly creating a publication after package upload when repo has autopublish enabled diff --git a/pulpcore/cli/rpm/content.py b/pulpcore/cli/rpm/content.py index 75364150..70e7ead9 100644 --- a/pulpcore/cli/rpm/content.py +++ b/pulpcore/cli/rpm/content.py @@ -401,7 +401,12 @@ def upload( # Sanity: ignore publish|use_temp unless destination-repository has been specified use_tmp = final_dest_repo_ctx and kwargs["use_temp_repository"] - do_publish = final_dest_repo_ctx and kwargs["publish"] + # Publish if autopublish is not enabled on the repository + do_publish = ( + final_dest_repo_ctx + and kwargs["publish"] + and not final_dest_repo_ctx.entity["autopublish"] + ) # Sanity: ignore relative_path if directory specified if directory and kwargs["relative_path"]: