Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pulp_ansible/app/migrations/0042_ansiblerepository_gpgkey.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Generated by Django 3.2.13 on 2022-07-01 10:19

import gnupg
import tempfile

from django.db import migrations, models


def migrate_keyring_to_gpgkey_on_repository_up(apps, schema_editor):
try:
import gnupg
except ImportError:
print("gnupg is not installed, skipping migration")
Comment on lines +11 to +12
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we need to provide a little bit more information somewhere.
If I read the rest of the file correctly, it is built to be resiliant but also talks about the repositories failed to migrate.
Otoh it's a rather old migration that just ever so slightly missed the (first) last squashing.
Can we purge migrations at this point and squash again?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get away with it, because every installation of a supported branch must have run this migration already.
Also:
#2517

return

AnsibleRepository = apps.get_model('ansible', 'AnsibleRepository')
changed_repos = []
with tempfile.TemporaryDirectory() as gnupghome:
Expand Down
Loading