Skip to content

Commit 1317f6e

Browse files
authored
Merge pull request #330 from rajulkumar/fix_copy_repo
Fixed copy_repo copied all content types when copying only rpms
2 parents 35eea0c + 4212bf1 commit 1317f6e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/pubtools/_pulp/tasks/copy_repo.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,14 @@ def str_to_content_type(content_type_id):
148148
# criteria for all non-rpm content types
149149
# unit_fields are ignored as they are small in size and the repos have
150150
# small unit counts for non-rpm content types
151-
criteria.append(
152-
Criteria.with_field(
153-
"content_type_id", Matcher.in_(sorted(non_rpm_content_types))
151+
if non_rpm_content_types:
152+
# type_id filter with empty list includes all the content types.
153+
# hence, check for the presence of non-rpm content types.
154+
criteria.append(
155+
Criteria.with_field(
156+
"content_type_id", Matcher.in_(sorted(non_rpm_content_types))
157+
)
154158
)
155-
)
156159

157160
# criteria for rpm content types
158161
# unit_fields to keep a check on memory consumption with large rpm unit

0 commit comments

Comments
 (0)