Skip to content

Commit

Permalink
bugfix: Add default value fir signatures and marks
Browse files Browse the repository at this point in the history
When syncing from a remote that has no marks or no signatures (older
version) this ensures the field on sync defaults to empty list avoiding
iteration error.

fixes: pulp#1387
  • Loading branch information
rochacbruno committed Mar 3, 2023
1 parent da32f91 commit 5d354e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/1387.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed broken sync form servers without signatures or marks.
4 changes: 2 additions & 2 deletions pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ async def _add_collection_version(self, api_version, collection_version_url, met
self.already_synced.add(cv_unique)

info = metadata["metadata"]
signatures = metadata.get("signatures")
marks = metadata.get("marks") # List[str]
signatures = metadata.get("signatures", [])
marks = metadata.get("marks", [])

if self.signed_only and not signatures:
return
Expand Down

0 comments on commit 5d354e8

Please sign in to comment.