Skip to content

Commit 60d5ccd

Browse files
committed
tmp3
1 parent 1b85ec1 commit 60d5ccd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pulp_python/app/migrations/0019_create_missing_metadata_artifacts.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def create_missing_metadata_artifacts(apps, schema_editor):
133133
.prefetch_related("contentartifact_set")
134134
.only("filename", "metadata_sha256")
135135
)
136+
skipped_pkgs = []
136137
artifact_batch = []
137138
contentartifact_batch = []
138139

@@ -149,6 +150,7 @@ def create_missing_metadata_artifacts(apps, schema_editor):
149150
)
150151
if not metadata_artifact:
151152
# Failed to build metadata artifact
153+
skipped_pkgs.append(package.pk)
152154
continue
153155
if mismatched_sha256:
154156
# Fix the package if its metadata_sha256 differs from the actual value
@@ -173,6 +175,10 @@ def create_missing_metadata_artifacts(apps, schema_editor):
173175
Artifact.objects.bulk_create(artifact_batch, batch_size=BATCH_SIZE)
174176
ContentArtifact.objects.bulk_create(contentartifact_batch, batch_size=BATCH_SIZE)
175177

178+
print(
179+
f"Skipped creation of missing metadata artifacts for the following packages: {skipped_pkgs}"
180+
)
181+
176182

177183
class Migration(migrations.Migration):
178184

0 commit comments

Comments
 (0)