diff options
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/config.py | 4 | ||||
-rw-r--r-- | ipalib/frontend.py | 6 | ||||
-rw-r--r-- | ipalib/plugins/b_xmlrpc.py | 10 |
3 files changed, 16 insertions, 4 deletions
diff --git a/ipalib/config.py b/ipalib/config.py index 73d23c8e..f327cab7 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -23,7 +23,7 @@ DEFAULT_CONF='/etc/ipa/ipa.conf' def generate_env(d={}): default = dict( - server_context = True, + server_context = False, query_dns = True, verbose = False, servers = LazyIter(get_servers), @@ -35,7 +35,7 @@ def generate_env(d={}): default[key].set_value(value) else: default[key] = value - + return default diff --git a/ipalib/frontend.py b/ipalib/frontend.py index 7abb8fb0..651e4642 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -541,8 +541,10 @@ class Command(plugable.Plugin): print ' kw =', kw def forward(self, *args, **kw): - xmlrpc_client = self.api.Backend.xmlrpc.get_client() - return getattr(xmlrpc_client, self.name)(kw, *args) + """ + Forward call over XML-RPC. + """ + return self.api.Backend.xmlrpc.forward_call(self.name, *args, **kw) def __call__(self, *args, **kw): diff --git a/ipalib/plugins/b_xmlrpc.py b/ipalib/plugins/b_xmlrpc.py index afe76505..61935f01 100644 --- a/ipalib/plugins/b_xmlrpc.py +++ b/ipalib/plugins/b_xmlrpc.py @@ -25,6 +25,7 @@ Lightwieght XML-RPC client using Python standard library xmlrpclib. import xmlrpclib from ipalib.backend import Backend +from ipalib.util import xmlrpc_marshal from ipalib import api class xmlrpc(Backend): @@ -36,4 +37,13 @@ class xmlrpc(Backend): # FIXME: The server uri should come from self.api.env.server_uri return xmlrpclib.ServerProxy('http://localhost:8080', allow_none=True) + def forward_call(self, name, *args, **kw): + """ + Forward a call over XML-RPC to an IPA server. + """ + client = self.get_client() + command = getattr(client, name) + params = xmlrpc_marshal(*args, **kw) + return command(*params) + api.register(xmlrpc) |