Beispiel #1
0
    def relate_blob(self, dc):
        """
        Relate a Blob to a Manifest.

        Args:
            dc (pulpcore.plugin.stages.DeclarativeContent): dc for a Blob

        """
        related_dc = dc.extra_data.get('blob_relation')
        thru = BlobManifest(manifest=related_dc.content, manifest_blob=dc.content)
        try:
            thru.save()
        except IntegrityError:
            pass
    def relate_blob(self, dc):
        """
        Relate a Blob to a Manifest.

        Args:
            dc (pulpcore.plugin.stages.DeclarativeContent): dc for a Manifest
        """
        related_dc_id_list = dc.extra_data.get('blob_rel')
        # find blob by id
        # We are relying on the order of the processed DC
        # Blobs should have passed through ContentSaver stage already
        blob_list = Blob.objects.filter(digest__in=related_dc_id_list)
        for blob in blob_list:
            thru = BlobManifest(manifest=dc.content, manifest_blob=blob)
            thru.save()