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:
1 parent
8658864013
commit
a9f7300732
1 file changed
+5
-3
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user