Skip to content

Commit a481737

Browse files
committed
rpm: Skip explicit publishing after package upload if repo has autopublish enabled
closes #1284 Signed-off-by: Balasankar 'Balu' C <balu@dravidam.net>
1 parent ec2d9cf commit a481737

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES/1284.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix CLI explicitly creating a publication after package upload when repo has autopublish enabled

pulpcore/cli/rpm/content.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,12 @@ def upload(
401401

402402
# Sanity: ignore publish|use_temp unless destination-repository has been specified
403403
use_tmp = final_dest_repo_ctx and kwargs["use_temp_repository"]
404-
do_publish = final_dest_repo_ctx and kwargs["publish"]
404+
# Publish if autopublish is not enabled on the repository
405+
do_publish = (
406+
final_dest_repo_ctx
407+
and kwargs["publish"]
408+
and not final_dest_repo_ctx.entity["autopublish"]
409+
)
405410

406411
# Sanity: ignore relative_path if directory specified
407412
if directory and kwargs["relative_path"]:

0 commit comments

Comments
 (0)