Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/nixguix/loader.py
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | ) -> Dict[Sha1Git, Optional[ImmutableDict[str, object]]]: | ||||
ret = {} | ret = {} | ||||
for revision in known_revisions: | for revision in known_revisions: | ||||
if not revision: # revision_get can return None | if not revision: # revision_get can return None | ||||
continue | continue | ||||
ret[revision.id] = revision.metadata | ret[revision.id] = revision.metadata | ||||
return ret | return ret | ||||
def known_artifact_to_extid(self, known_artifact: Dict) -> Optional[PartialExtID]: | @staticmethod | ||||
def known_artifact_to_extid(known_artifact: Dict) -> Optional[PartialExtID]: | |||||
try: | try: | ||||
value = known_artifact["extrinsic"]["raw"]["integrity"].encode("ascii") | value = known_artifact["extrinsic"]["raw"]["integrity"].encode("ascii") | ||||
except KeyError as e: | except KeyError as e: | ||||
logger.exception( | logger.exception( | ||||
"Unexpected metadata revision structure detected: %(context)s", | "Unexpected metadata revision structure detected: %(context)s", | ||||
{"context": {"reason": str(e), "known_artifact": known_artifact,}}, | {"context": {"reason": str(e), "known_artifact": known_artifact,}}, | ||||
) | ) | ||||
# metadata field for the revision is not as expected by the loader | # metadata field for the revision is not as expected by the loader | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |