mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
schema plugin: Fix commands without metaobject arg
Previously, all the commands of schema plugin derived from BaseMetaSearch require metaobject as their argument (by implementation), but the spec for some of them only optionally asks for search criteria arg. This patch fixes this inconsistency. 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
540b01bc6e
commit
7706dfaf09
@ -129,8 +129,8 @@ class BaseMetaSearch(Search):
|
||||
"(\"%s\")") % 'name',
|
||||
)
|
||||
|
||||
def execute(self, command, criteria=None, **options):
|
||||
result = list(self.obj.search(command, criteria, **options))
|
||||
def execute(self, criteria=None, **options):
|
||||
result = list(self.obj.search(criteria, **options))
|
||||
return dict(result=result, count=len(result), truncated=False)
|
||||
|
||||
|
||||
@ -494,7 +494,9 @@ class BaseParamRetrieve(BaseParamMethod, BaseMetaRetrieve):
|
||||
|
||||
|
||||
class BaseParamSearch(BaseParamMethod, BaseMetaSearch):
|
||||
pass
|
||||
def execute(self, command, criteria=None, **options):
|
||||
result = list(self.obj.search(command, criteria, **options))
|
||||
return dict(result=result, count=len(result), truncated=False)
|
||||
|
||||
|
||||
@register()
|
||||
|
Loading…
Reference in New Issue
Block a user