summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/batch.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-06-30 09:32:00 +0200
committerJan Cholasta <jcholast@redhat.com>2016-06-30 16:32:20 +0200
commit2beb72ffa4bea5e22c2ba4685a524df36d1f800c (patch)
tree8b23c2860b420f68bce4c93de1c35707dac3ca8d /ipaserver/plugins/batch.py
parent8278da6967dbe425b4e0c6cf37dc1c53052525b2 (diff)
downloadfreeipa-2beb72ffa4bea5e22c2ba4685a524df36d1f800c.tar.gz
freeipa-2beb72ffa4bea5e22c2ba4685a524df36d1f800c.tar.xz
freeipa-2beb72ffa4bea5e22c2ba4685a524df36d1f800c.zip
server: exclude Local commands from RPC
Local API commands are not supposed to be executed over RPC but only locally on the server. They are already excluded from API schema, exclude them also from RPC and `batch` and `json_metadata` commands. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/plugins/batch.py')
-rw-r--r--ipaserver/plugins/batch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipaserver/plugins/batch.py b/ipaserver/plugins/batch.py
index aa4ace918..b0c89ec46 100644
--- a/ipaserver/plugins/batch.py
+++ b/ipaserver/plugins/batch.py
@@ -49,6 +49,7 @@ import six
from ipalib import api, errors
from ipalib import Command
+from ipalib.frontend import Local
from ipalib.parameters import Str, Dict
from ipalib.output import Output
from ipalib.text import _
@@ -98,7 +99,8 @@ class batch(Command):
if 'params' not in arg:
raise errors.RequirementError(name='params')
name = arg['method']
- if name not in self.Command:
+ if (name not in self.api.Command or
+ isinstance(self.api.Command[name], Local)):
raise errors.CommandError(name=name)
# If params are not formated as a tuple(list, dict)