Skip to content

Commit edd3be5

Browse files
committed
Fix a plugin check in RpmPackageContext
1 parent 32f5065 commit edd3be5

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

pulp-glue/pulp_glue/rpm/context.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import typing as t
22

33
from pulp_glue.common.context import (
4+
BATCH_SIZE,
45
EntityDefinition,
56
PluginRequirement,
67
PulpACSContext,
@@ -123,6 +124,15 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En
123124
self.pulp_ctx.needs_plugin(PluginRequirement("rpm", specifier=">=3.18.0"))
124125
else:
125126
PulpException(_("--relative-path must be provided"))
127+
return body
128+
129+
def list_iterator(
130+
self,
131+
parameters: t.Optional[t.Dict[str, t.Any]] = None,
132+
offset: int = 0,
133+
batch_size: int = BATCH_SIZE,
134+
stats: t.Optional[t.Dict[str, t.Any]] = None,
135+
) -> t.Iterator[t.Any]:
126136
contains_startswith = [
127137
"name__contains",
128138
"name__startswith",
@@ -131,11 +141,18 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En
131141
"arch__contains",
132142
"arch__startswith",
133143
]
134-
if any(k in body for k in contains_startswith):
144+
if parameters is not None and any(
145+
v for k, v in parameters.items() for k in contains_startswith
146+
):
135147
self.pulp_ctx.needs_plugin(
136148
PluginRequirement("rpm", specifier=">=3.20.0", feature=_("substring filters"))
137149
)
138-
return body
150+
return super().list_iterator(
151+
parameters=parameters,
152+
offset=offset,
153+
batch_size=batch_size,
154+
stats=stats,
155+
)
139156

140157

141158
class PulpRpmAdvisoryContext(PulpContentContext):

0 commit comments

Comments
 (0)