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"]: