Skip to content

Commit

Permalink
Fix publications created by mirrored syncs not having checksum_type set
Browse files Browse the repository at this point in the history
closes #3484
  • Loading branch information
dralley authored and ggainey committed Mar 28, 2024
1 parent ded2723 commit 8170b0b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/3484.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix publications created by mirror_complete syncs not having checksum_type set properly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.5 on 2023-11-07 03:51

from django.db import migrations, models


def set_publication_checksum(apps, schema_editor):
RpmPublication = apps.get_model("rpm", "RpmPublication")
RpmPublication.objects.filter(checksum_type="").update(checksum_type="unknown")


class Migration(migrations.Migration):

dependencies = [
('rpm', '0059_rpmpublication_compression_type_and_more'),
]

operations = [
migrations.RunPython(set_publication_checksum),
]
1 change: 1 addition & 0 deletions pulp_rpm/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ def is_subrepo(directory):
)
repo_gpgcheck = has_repomd_signature and repository.repo_config.get("repo_gpgcheck", 0)

publication.checksum_type = CHECKSUM_TYPES.UNKNOWN
publication.package_checksum_type = CHECKSUM_TYPES.UNKNOWN
publication.metadata_checksum_type = CHECKSUM_TYPES.UNKNOWN
publication.repo_config = {
Expand Down

0 comments on commit 8170b0b

Please sign in to comment.