Skip to content

Commit

Permalink
Add feature to pulp-glue check, also remove check from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyz committed May 17, 2024
1 parent 055e113 commit 2b5e2c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 6 additions & 1 deletion pulp-glue/pulp_glue/rpm/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En
PulpException(_("--relative-path must be provided"))
contains_startswith = ["name__contains", "name__startswith", "release__contains", "release__startswith", "arch__contains", "arch__startswith"]
if any(k in body for k in contains_startswith):
self.pulp_ctx.needs_plugin(PluginRequirement("rpm", specifier = ">=3.20.0"))
self.pulp_ctx.needs_plugin(
PluginRequirement(
"rpm",
specifier = ">=3.20.0",
feature = _("substring filters")
))
return body


Expand Down
6 changes: 0 additions & 6 deletions pulpcore/cli/rpm/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ def content() -> None:
pulp_option("--arch", allowed_with_contexts=(PulpRpmPackageContext,)),
pulp_option(
"--arch-contains", "arch__contains", allowed_with_contexts=(PulpRpmPackageContext,),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option(
"--arch-in", "arch__in", multiple=True, allowed_with_contexts=(PulpRpmPackageContext,)
),
pulp_option("--arch-ne", "arch__ne", allowed_with_contexts=(PulpRpmPackageContext,)),
pulp_option(
"--arch-startswith", "arch__startswith", allowed_with_contexts=(PulpRpmPackageContext,),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option("--epoch", allowed_with_contexts=(PulpRpmPackageContext,)),
pulp_option(
Expand All @@ -144,7 +142,6 @@ def content() -> None:
"--name-contains",
"name__contains",
allowed_with_contexts=(PulpRpmPackageContext, PulpRpmModulemdContext),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option(
"--name-in",
Expand All @@ -161,7 +158,6 @@ def content() -> None:
"--name-startswith",
"name__startswith",
allowed_with_contexts=(PulpRpmPackageContext, PulpRpmModulemdContext),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option("--package-href", allowed_with_contexts=(PulpRpmPackageContext,)),
pulp_option("--pkgId", allowed_with_contexts=(PulpRpmPackageContext,)),
Expand All @@ -174,7 +170,6 @@ def content() -> None:
pulp_option("--release", allowed_with_contexts=(PulpRpmPackageContext,)),
pulp_option(
"--release-contains", "release__contains", allowed_with_contexts=(PulpRpmPackageContext,),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option(
"--release-in", "release__in", multiple=True, allowed_with_contexts=(PulpRpmPackageContext,)
Expand All @@ -184,7 +179,6 @@ def content() -> None:
"--release-startswith",
"release__startswith",
allowed_with_contexts=(PulpRpmPackageContext,),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.20.0")],
),
pulp_option("--severity", allowed_with_contexts=(PulpRpmAdvisoryContext,)),
pulp_option(
Expand Down

0 comments on commit 2b5e2c7

Please sign in to comment.