Skip to content

Commit

Permalink
Fix syncing total count when using signed_only=True
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrod3 authored and mdellweg committed Dec 11, 2023
1 parent 1c3ad11 commit 5fecc4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/1608.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed syncing progress report, `Parsing CollectionVersion Metadata`, total count when using `signed_only=True`.
11 changes: 8 additions & 3 deletions pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,17 +585,23 @@ async def _add_collection_version(self, api_version, collection_version_url, met
)
cv_unique = attrgetter("namespace", "name", "version")(collection_version)
fullname, version = f"{cv_unique[0]}.{cv_unique[1]}", cv_unique[2]
if fullname in self.exclude_info and Version(version) in self.exclude_info[fullname]:
return
if cv_unique in self.already_synced:
return

# Mark the collection version as being processed
self.already_synced.add(cv_unique)
await self.parsing_metadata_progress_bar.aincrement()

if fullname in self.exclude_info and Version(version) in self.exclude_info[fullname]:
log.debug(_("{}-{} is in excludes list, skipping").format(fullname, version))
return

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

if self.signed_only and not signatures:
log.debug(_("{}-{} does not have any signatures, skipping").format(fullname, version))
return

if self.add_dependents:
Expand Down Expand Up @@ -635,7 +641,6 @@ async def _add_collection_version(self, api_version, collection_version_url, met
d_artifacts=[d_artifact],
extra_data=extra_data,
)
await self.parsing_metadata_progress_bar.aincrement()
await self.put(d_content)

if signatures or marks:
Expand Down

0 comments on commit 5fecc4d

Please sign in to comment.