From 1e836d2d0c8916f5b8a352cc8395048f1147554d Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 19 Dec 2012 04:25:24 -0500 Subject: Switch client to JSON-RPC Modify ipalib.rpc to support JSON-RPC in addition to XML-RPC. This is done by subclassing and extending xmlrpclib, because our existing code relies on xmlrpclib internals. The URI to use is given in the new jsonrpc_uri env variable. When it is not given, it is generated from xmlrpc_uri by replacing /xml with /json. The rpc_json_uri env variable existed before, but was unused, undocumented and not set the install scripts. This patch removes it in favor of jsonrpc_uri (for consistency with xmlrpc_uri). Add the rpc_protocol env variable to control the protocol IPA uses. rpc_protocol defaults to 'jsonrpc', but may be changed to 'xmlrpc'. Make backend.Executioner and tests use the backend specified by rpc_protocol. For compatibility with unwrap_xml, decoding JSON now gives tuples instead of lists. Design: http://freeipa.org/page/V3/JSON-RPC Ticket: https://fedorahosted.org/freeipa/ticket/3299 --- ipalib/frontend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipalib/frontend.py') diff --git a/ipalib/frontend.py b/ipalib/frontend.py index f478ef098..4d0333e0d 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -742,7 +742,7 @@ class Command(HasParam): actually work this command performs is executed locally. If running in a non-server context, `Command.forward` is called, - which forwards this call over XML-RPC to the exact same command + which forwards this call over RPC to the exact same command on the nearest IPA server and the actual work this command performs is executed remotely. """ @@ -777,9 +777,9 @@ class Command(HasParam): def forward(self, *args, **kw): """ - Forward call over XML-RPC to this same command on server. + Forward call over RPC to this same command on server. """ - return self.Backend.xmlclient.forward(self.name, *args, **kw) + return self.Backend.rpcclient.forward(self.name, *args, **kw) def _on_finalize(self): """ -- cgit