Skip to content

Commit 8325ebd

Browse files
authored
Merge branch 'master' into pulp3client
2 parents b50477c + 247a9bc commit 8325ebd

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Added pulp3 client
1111

12+
## [2.43.3] - 2026-06-01
13+
14+
### Fixed
15+
- YumSyncOption's `skip` parameter is now correctly passed to the rhsm-pulp API as `type_skip_list`
16+
1217
## [2.43.2] - 2026-01-21
1318

1419
- Extra release due to issues with pypi release

src/pubtools/pulplib/_impl/model/repository/base.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import json
55
from functools import partial
66

7-
from attr import validators, asdict, converters
7+
from attr import validators, converters
88

99
from frozenlist2 import frozenlist
1010
from more_executors.futures import f_proxy, f_map, f_flat_map
@@ -651,11 +651,16 @@ def sync(self, options=None):
651651
if not self._client:
652652
raise DetachedException()
653653

654-
return f_proxy(
655-
self._client._do_sync(
656-
self.id, asdict(options, filter=lambda name, val: val is not None)
657-
)
658-
)
654+
# Convert sync options to dict, respecting pulp_field metadata
655+
sync_config = {}
656+
for field in attr.fields(type(options)):
657+
value = getattr(options, field.name)
658+
if value is not None:
659+
# Use pulp_field if available, otherwise use field name
660+
pulp_field = field.metadata.get(PULP2_FIELD, field.name)
661+
sync_config[pulp_field] = value
662+
663+
return f_proxy(self._client._do_sync(self.id, sync_config))
659664

660665
def lock(self, context, duration=None):
661666
"""

src/pubtools/pulplib/_impl/model/repository/yum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class YumSyncOptions(SyncOptions):
4343
"""Count indicating how many old rpm versions to retain.
4444
"""
4545

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

tests/repository/test_sync.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def test_sync_with_options(
6060
repo = YumRepository(id="some-repo")
6161
repo.__dict__["_client"] = client
6262

63-
options = YumSyncOptions(ssl_validation=False, feed="mock://example.com/")
63+
options = YumSyncOptions(
64+
ssl_validation=False, feed="mock://example.com/", skip=["drpm", "srpm"]
65+
)
6466

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

0 commit comments

Comments
 (0)