Skip to content

Commit fa0f37d

Browse files
authored
Merge pull request #221 from rbikar/repo_attr_fix
Improve `Repository` attrs [RHELDST-22483]
2 parents 994052e + 5e8ed84 commit fa0f37d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

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

7-
from attr import validators, asdict
7+
from attr import validators, asdict, converters
8+
89
from frozenlist2 import frozenlist
910
from more_executors.futures import f_proxy, f_map, f_flat_map
1011

@@ -247,8 +248,8 @@ class Repository(PulpObject, Deletable):
247248
default=None,
248249
type=int,
249250
pulp_field="notes.eng_product",
250-
pulp_py_converter=int,
251-
py_pulp_converter=str,
251+
pulp_py_converter=converters.optional(int),
252+
py_pulp_converter=converters.optional(str),
252253
)
253254
"""ID of the product to which this repository belongs (if any)."""
254255

pubtools/pulplib/_impl/schema/repository.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ properties:
9898

9999
# Name of content set that is associated with this repository
100100
content_set:
101-
type: string
101+
anyOf:
102+
- type: "null"
103+
- type: string
102104

103105
# Version of ubi config that should be used for population of this repository
104106
ubi_config_version:

0 commit comments

Comments
 (0)