mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 00:31:56 -06:00
command_defaults: Don't crash on nonexistent command
It's common for ipa commands to raise NotFound in such a case. Fixes: https://pagure.io/freeipa/issue/8954 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
parent
7706dfaf09
commit
210739c0ed
@ -292,6 +292,13 @@ class command_defaults(PKQuery):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, name, **options):
|
def execute(self, name, **options):
|
||||||
|
if name not in self.api.Command:
|
||||||
|
raise errors.NotFound(
|
||||||
|
reason=_("{oname}: {command_name} not found").format(
|
||||||
|
oname=self.name, command_name=name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
command = self.api.Command[name]
|
command = self.api.Command[name]
|
||||||
|
|
||||||
params = options.get('params') or []
|
params = options.get('params') or []
|
||||||
|
Loading…
Reference in New Issue
Block a user