summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-06-21 12:07:21 +0200
committerJan Cholasta <jcholast@redhat.com>2016-06-28 13:30:49 +0200
commit4284d4fb4da1049c8b9f23d838f963b301aef97d (patch)
tree26b1a69fc7438923fea34daf50140a1058af1fac /ipaserver
parent79d1f5833547044a7cb2700454cacb2a0976dd5f (diff)
downloadfreeipa-4284d4fb4da1049c8b9f23d838f963b301aef97d.tar.gz
freeipa-4284d4fb4da1049c8b9f23d838f963b301aef97d.tar.xz
freeipa-4284d4fb4da1049c8b9f23d838f963b301aef97d.zip
plugable: support plugin versioning
Allow multiple incompatible versions of a plugin using the same name. The current plugins are assumed to be version '1'. The unique identifier of plugins was changed from plugin name to plugin name and version. By default, the highest version available at build time is used. If the plugin is an unknown remote plugin, version of '1' is used by default. https://fedorahosted.org/freeipa/ticket/4427 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/internal.py6
-rw-r--r--ipaserver/rpcserver.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py
index c0360567c..768433b94 100644
--- a/ipaserver/plugins/internal.py
+++ b/ipaserver/plugins/internal.py
@@ -82,6 +82,7 @@ class json_metadata(Command):
elif objname == "all":
objects = dict(
(o.name, json_serialize(o)) for o in self.api.Object()
+ if o is self.api.Object[o.name]
)
empty = False
except KeyError:
@@ -96,6 +97,7 @@ class json_metadata(Command):
elif methodname == "all":
methods = dict(
(m.name, json_serialize(m)) for m in self.api.Method()
+ if m is self.api.Method[m.name]
)
empty = False
except KeyError:
@@ -109,6 +111,7 @@ class json_metadata(Command):
elif cmdname == "all":
commands = dict(
(c.name, json_serialize(c)) for c in self.api.Command()
+ if c is self.api.Command[c.name]
)
empty = False
except KeyError:
@@ -117,12 +120,15 @@ class json_metadata(Command):
if empty:
objects = dict(
(o.name, json_serialize(o)) for o in self.api.Object()
+ if o is self.api.Object[o.name]
)
methods = dict(
(m.name, json_serialize(m)) for m in self.api.Method()
+ if m is self.api.Method[m.name]
)
commands = dict(
(c.name, json_serialize(c)) for c in self.api.Command()
+ if c is self.api.Command[c.name]
)
retval = dict([
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 852cf2ebe..98a243d53 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -673,7 +673,8 @@ class xmlserver(KerberosWSGIExecutioner):
"""list methods for XML-RPC introspection"""
if params:
raise errors.ZeroArgumentError(name='system.listMethods')
- return (tuple(unicode(cmd.name) for cmd in self.Command()) +
+ return (tuple(unicode(cmd.name) for cmd in self.Command()
+ if cmd is self.Command[cmd.name]) +
tuple(unicode(name) for name in self._system_commands))
def _get_method_name(self, name, *params):