Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fake client copy_content: treat require_signed_rpms the same as real #219

Closed
wants to merge 1 commit into from
Closed
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
32 changes: 16 additions & 16 deletions pubtools/pulplib/_impl/fake/client.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import random
import hashlib
import json
import random
import re

from collections import namedtuple
from io import BytesIO, StringIO

from io import StringIO, BytesIO

from more_executors.futures import f_return, f_return_error, f_flat_map, f_proxy
from more_executors.futures import f_flat_map, f_proxy, f_return, f_return_error

from pubtools.pulplib import (
CopyOptions,
Criteria,
Distributor,
MaintenanceReport,
Page,
PulpException,
Criteria,
Task,
Repository,
Distributor,
Unit,
RpmUnit,
MaintenanceReport,
CopyOptions,
Task,
Unit,
YumRepository,
)
from pubtools.pulplib._impl.client.client import UploadResult
from pubtools.pulplib._impl.client.search import search_for_criteria
from .. import compat_attr as attr

from .match import match_object
from .. import compat_attr as attr
from . import units
from .match import match_object

Publish = namedtuple("Publish", ["repository", "tasks"])
Upload = namedtuple("Upload", ["repository", "tasks", "name", "sha256"])
Expand Down Expand Up @@ -136,9 +135,10 @@ def copy_content(

# RPM signature filter: if signatures are required, unsigned RPMs are not
# included in the copy.
# Because we don't model this flag on distributor objects and because in
# practice it's set to True, we default to True.
if options.require_signed_rpms is not False:
if (
isinstance(to_repository, YumRepository)
and options.require_signed_rpms is not None
):
found = [u for u in found if not isinstance(u, RpmUnit) or u.signing_key]

# Units are being copied to this repo, so that value obviously must appear
Expand Down
Loading