diff options
Diffstat (limited to 'ipaserver/plugins')
| -rw-r--r-- | ipaserver/plugins/batch.py | 4 | ||||
| -rw-r--r-- | ipaserver/plugins/internal.py | 19 |
2 files changed, 16 insertions, 7 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) diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py index 5c1cfb885..5eee7572e 100644 --- a/ipaserver/plugins/internal.py +++ b/ipaserver/plugins/internal.py @@ -24,6 +24,7 @@ Plugins not accessible directly through the CLI, commands used internally """ from ipalib import Command from ipalib import Str +from ipalib.frontend import Local from ipalib.output import Output from ipalib.text import _ from ipalib.util import json_serialize @@ -91,13 +92,15 @@ class json_metadata(Command): try: if not methodname: methodname = options['method'] - if methodname in self.api.Method: + if (methodname in self.api.Method and + not isinstance(self.api.Method[methodname], Local)): m = self.api.Method[methodname] methods = dict([(m.name, json_serialize(m))]) elif methodname == "all": methods = dict( (m.name, json_serialize(m)) for m in self.api.Method() - if m is self.api.Method[m.name] + if (m is self.api.Method[m.name] and + not isinstance(m, Local)) ) empty = False except KeyError: @@ -105,13 +108,15 @@ class json_metadata(Command): try: cmdname = options['command'] - if cmdname in self.api.Command: + if (cmdname in self.api.Command and + not isinstance(self.api.Command[cmdname], Local)): c = self.api.Command[cmdname] commands = dict([(c.name, json_serialize(c))]) elif cmdname == "all": commands = dict( (c.name, json_serialize(c)) for c in self.api.Command() - if c is self.api.Command[c.name] + if (c is self.api.Command[c.name] and + not isinstance(c, Local)) ) empty = False except KeyError: @@ -124,11 +129,13 @@ class json_metadata(Command): ) methods = dict( (m.name, json_serialize(m)) for m in self.api.Method() - if m is self.api.Method[m.name] + if (m is self.api.Method[m.name] and + not isinstance(m, Local)) ) commands = dict( (c.name, json_serialize(c)) for c in self.api.Command() - if c is self.api.Command[c.name] + if (c is self.api.Command[c.name] and + not isinstance(c, Local)) ) retval = dict([ |
