Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- n/a
### Fixed
- YumSyncOption's `skip` parameter is now correctly passed to the rhsm-pulp API as `type_skip_list`

## [2.43.2] - 2026-01-21

Expand Down
17 changes: 11 additions & 6 deletions src/pubtools/pulplib/_impl/model/repository/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
from functools import partial

from attr import validators, asdict, converters
from attr import validators, converters

from frozenlist2 import frozenlist
from more_executors.futures import f_proxy, f_map, f_flat_map
Expand Down Expand Up @@ -651,11 +651,16 @@ def sync(self, options=None):
if not self._client:
raise DetachedException()

return f_proxy(
self._client._do_sync(
self.id, asdict(options, filter=lambda name, val: val is not None)
)
)
# Convert sync options to dict, respecting pulp_field metadata
sync_config = {}
for field in attr.fields(type(options)):
value = getattr(options, field.name)
if value is not None:
# Use pulp_field if available, otherwise use field name
pulp_field = field.metadata.get(PULP2_FIELD, field.name)
sync_config[pulp_field] = value

return f_proxy(self._client._do_sync(self.id, sync_config))

def lock(self, context, duration=None):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/pubtools/pulplib/_impl/model/repository/yum.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class YumSyncOptions(SyncOptions):
"""Count indicating how many old rpm versions to retain.
"""

skip = pulp_attrib(default=None, type=list)
skip = pulp_attrib(default=None, type=list, pulp_field="type_skip_list")
"""List of content types to be skipped during the repository synchronization
"""

Expand Down
6 changes: 5 additions & 1 deletion tests/repository/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_sync_with_options(
repo = YumRepository(id="some-repo")
repo.__dict__["_client"] = client

options = YumSyncOptions(ssl_validation=False, feed="mock://example.com/")
options = YumSyncOptions(
ssl_validation=False, feed="mock://example.com/", skip=["drpm", "srpm"]
)

# It should have succeeded, with the tasks as retrieved from Pulp
assert repo.sync(options).result() == [
Expand All @@ -72,4 +74,6 @@ def test_sync_with_options(
assert req[0].json()["override_config"] == {
"ssl_validation": False,
"feed": "mock://example.com/",
# Verify that 'skip' is passed as 'type_skip_list' in the API call
"type_skip_list": ["drpm", "srpm"],
}
Loading