Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Pulp2 content that is missing downloaded flag is treated as downloaded
Browse files Browse the repository at this point in the history
closes #8863
  • Loading branch information
ipanova authored and goosemania committed Jun 14, 2021
1 parent 69d0120 commit e39528a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/8863.bugfix
@@ -0,0 +1 @@
Pulp2 Content that does not have downloaded flag is marked as downloaded.
10 changes: 8 additions & 2 deletions pulp_2to3_migration/app/pre_migration.py
Expand Up @@ -186,7 +186,10 @@ def delete_removed_pulp2_content(content_model):
pulp2detail_pb.total -= 1
continue

downloaded = record.downloaded if hasattr(record, 'downloaded') else False
# very old pulp2 content will not have downloaded field set (prior to lazy sync)
downloaded = hasattr(record, 'downloaded') and (
record.downloaded or record.downloaded is None
)

if set_pulp2_repo:
# This content requires to set pulp 2 repo. E.g. for errata, because 1 pulp2
Expand Down Expand Up @@ -299,7 +302,10 @@ def delete_removed_pulp2_content(content_model):

for relation in content_relations:
record = pulp2_content_by_id[relation.pulp2_unit_id]
downloaded = record.downloaded if hasattr(record, 'downloaded') else False
# very old pulp2 content will not have downloaded field set (prior to lazy sync)
downloaded = hasattr(record, 'downloaded') and (
record.downloaded or record.downloaded is None
)
specific_content_q = Q(
pulp2_content_type_id=record._content_type_id,
pulp2_id=record.id,
Expand Down

0 comments on commit e39528a

Please sign in to comment.