From 841122538ed577aa0846467b17fdc3f70ba552fe Mon Sep 17 00:00:00 2001 From: Jitka Halova Date: Wed, 18 Mar 2026 14:53:05 +0100 Subject: [PATCH] Fix missing raise statements for exceptions --- pulp-glue/src/pulp_glue/common/context.py | 2 +- pulp-glue/src/pulp_glue/rpm/context.py | 3 --- src/pulpcore/cli/core/task.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pulp-glue/src/pulp_glue/common/context.py b/pulp-glue/src/pulp_glue/common/context.py index f5257d239..a3b376a15 100644 --- a/pulp-glue/src/pulp_glue/common/context.py +++ b/pulp-glue/src/pulp_glue/common/context.py @@ -1617,7 +1617,7 @@ def get_version_context( elif number == -1: version_href = self.entity["latest_version_href"] else: - PulpException(_("Invalid version number ({number}).").format(number=number)) + raise PulpException(_("Invalid version number ({number}).").format(number=number)) else: version_href = None return self.VERSION_CONTEXT( diff --git a/pulp-glue/src/pulp_glue/rpm/context.py b/pulp-glue/src/pulp_glue/rpm/context.py index 897c28a6e..32c3ee67a 100644 --- a/pulp-glue/src/pulp_glue/rpm/context.py +++ b/pulp-glue/src/pulp_glue/rpm/context.py @@ -15,7 +15,6 @@ PulpViewSetContext, api_spec_quirk, ) -from pulp_glue.common.exceptions import PulpException from pulp_glue.common.i18n import get_translation translation = get_translation(__package__) @@ -115,8 +114,6 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En if partial is False: if body.get("relative_path") is None: self.pulp_ctx.needs_plugin(PluginRequirement("rpm", specifier=">=3.18.0")) - else: - PulpException(_("--relative-path must be provided")) return body def list_iterator( diff --git a/src/pulpcore/cli/core/task.py b/src/pulpcore/cli/core/task.py index 6ece44767..e5ab186bc 100644 --- a/src/pulpcore/cli/core/task.py +++ b/src/pulpcore/cli/core/task.py @@ -166,7 +166,7 @@ def cancel( else: entity = task_ctx.entity if entity["state"] not in ["waiting", "running"]: - click.ClickException( + raise click.ClickException( _("Task {href} is in state {state} and cannot be canceled.").format( href=task_ctx.pulp_href, state=entity["state"] )