Skip to content

Commit 138d055

Browse files
jobselkomdellweg
authored andcommitted
Fix missing raise statements for exceptions
1 parent a0e036d commit 138d055

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

pulp-glue/src/pulp_glue/common/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ def get_version_context(
16171617
elif number == -1:
16181618
version_href = self.entity["latest_version_href"]
16191619
else:
1620-
PulpException(_("Invalid version number ({number}).").format(number=number))
1620+
raise PulpException(_("Invalid version number ({number}).").format(number=number))
16211621
else:
16221622
version_href = None
16231623
return self.VERSION_CONTEXT(

pulp-glue/src/pulp_glue/rpm/context.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
PulpViewSetContext,
1616
api_spec_quirk,
1717
)
18-
from pulp_glue.common.exceptions import PulpException
1918
from pulp_glue.common.i18n import get_translation
2019

2120
translation = get_translation(__package__)
@@ -115,8 +114,6 @@ def preprocess_entity(self, body: EntityDefinition, partial: bool = False) -> En
115114
if partial is False:
116115
if body.get("relative_path") is None:
117116
self.pulp_ctx.needs_plugin(PluginRequirement("rpm", specifier=">=3.18.0"))
118-
else:
119-
PulpException(_("--relative-path must be provided"))
120117
return body
121118

122119
def list_iterator(

src/pulpcore/cli/core/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def cancel(
166166
else:
167167
entity = task_ctx.entity
168168
if entity["state"] not in ["waiting", "running"]:
169-
click.ClickException(
169+
raise click.ClickException(
170170
_("Task {href} is in state {state} and cannot be canceled.").format(
171171
href=task_ctx.pulp_href, state=entity["state"]
172172
)

0 commit comments

Comments
 (0)