Skip to content

Commit 1296e56

Browse files
committed
tmp
1 parent 02d63d3 commit 1296e56

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pulp_python/app/migrations/0019_create_missing_metadata_artifacts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def create_missing_metadata_artifacts(apps, schema_editor):
155155
PythonPackageContent.objects.filter(metadata_sha256__isnull=False)
156156
.exclude(metadata_sha256="")
157157
.prefetch_related("contentartifact_set")
158+
.only("filename", "metadata_sha256")
158159
)
159160
# todo: only for testing, remove later
160161
created_count = 0
161162
skipped_count = 0
162163

163-
# todo: do i need temp dir? (not needed in localhost)
164164
with tempfile.TemporaryDirectory(dir=settings.WORKING_DIRECTORY) as temp_dir:
165165
for package in packages:
166166
metadata_relative_path = f"{package.filename}.metadata"
@@ -195,7 +195,7 @@ def create_missing_metadata_artifacts(apps, schema_editor):
195195
)
196196
created_count += 1
197197
except Exception:
198-
# Failed to save metadata artifact
198+
# Failed to save metadata content artifact
199199
skipped_count += 1
200200

201201
print(f"Created {created_count} missing metadata artifacts. Skipped {skipped_count} packages.")

pulp_python/app/tasks/sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ async def create_content(self, pkg):
255255
if upstream_pkg.has_metadata:
256256
url = upstream_pkg.metadata_url
257257
md_sha256 = upstream_pkg.metadata_digests.get("sha256")
258+
package.metadata_sha256 = md_sha256
258259
artifact = Artifact(sha256=md_sha256)
259260

260261
metadata_artifact = DeclarativeArtifact(

0 commit comments

Comments
 (0)