Skip to content

Commit

Permalink
Fix is_highest logic on resyncs
Browse files Browse the repository at this point in the history
fixes: pulp#1547
  • Loading branch information
gerrod3 committed Aug 7, 2023
1 parent ae4598e commit f238686
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/1547.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a sporadic sync error when re-syncing a repository with new collection versions.
5 changes: 5 additions & 0 deletions pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ def is_new_highest(new, old):

# exit if the new CV is not higher
if not is_new_highest(Version(collection_version.version), Version(last_highest.version)):
# Ensure that this collection_version doesn't have is_highest improperly set
if collection_version.is_highest:
collection_version.is_highest = False
if save:
collection_version.save(update_fields=["is_highest"])
return

last_highest.is_highest = False
Expand Down

0 comments on commit f238686

Please sign in to comment.