summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2010-03-26 03:56:53 -0600
committerRob Crittenden <rcritten@redhat.com>2010-03-30 15:10:58 -0400
commit918721c1d0ad0b330825aa9e3f464f36e31ad0c1 (patch)
tree5195820ceb404e0ce19f7d36c15969c41775253a
parent09d3a6b910b9651e9c8d59917d32a0622409f2e8 (diff)
downloadfreeipa-918721c1d0ad0b330825aa9e3f464f36e31ad0c1.tar.gz
freeipa-918721c1d0ad0b330825aa9e3f464f36e31ad0c1.tar.xz
freeipa-918721c1d0ad0b330825aa9e3f464f36e31ad0c1.zip
XML-RPC signature change
-rw-r--r--ipalib/rpc.py2
-rw-r--r--ipaserver/rpcserver.py7
-rw-r--r--tests/test_ipalib/test_rpc.py2
-rw-r--r--tests/test_ipaserver/test_rpcserver.py6
4 files changed, 7 insertions, 10 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 62f1d776..e7f33384 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -401,7 +401,7 @@ class xmlclient(Connectible):
)
self.info('Forwarding %r to server %r', name, self.env.xmlrpc_uri)
command = getattr(self.conn, name)
- params = args + (kw,)
+ params = [args, kw]
try:
response = command(*xml_wrap(params))
return xml_unwrap(response)
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 667a7c4c..795a240d 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -72,12 +72,11 @@ def read_input(environ):
def params_2_args_options(params):
- assert type(params) is tuple
if len(params) == 0:
return (tuple(), dict())
- if type(params[-1]) is dict:
- return (params[:-1], params[-1])
- return (params, dict())
+ if len(params) == 1:
+ return (params[0], dict())
+ return (params[0], params[1])
def nicify_query(query, encoding='utf-8'):
diff --git a/tests/test_ipalib/test_rpc.py b/tests/test_ipalib/test_rpc.py
index 83092b5d..a87b65a0 100644
--- a/tests/test_ipalib/test_rpc.py
+++ b/tests/test_ipalib/test_rpc.py
@@ -204,7 +204,7 @@ class test_xmlclient(PluginTester):
(o, api, home) = self.instance('Backend', user_add, in_server=False)
args = (binary_bytes, utf8_bytes, unicode_str)
kw = dict(one=binary_bytes, two=utf8_bytes, three=unicode_str)
- params = args + (kw,)
+ params = [args, kw]
result = (unicode_str, binary_bytes, utf8_bytes)
conn = DummyClass(
(
diff --git a/tests/test_ipaserver/test_rpcserver.py b/tests/test_ipaserver/test_rpcserver.py
index 294d349d..2f52662f 100644
--- a/tests/test_ipaserver/test_rpcserver.py
+++ b/tests/test_ipaserver/test_rpcserver.py
@@ -79,10 +79,8 @@ def test_params_2_args_options():
args = ('Hello', u'world!')
options = dict(one=1, two=u'Two', three='Three')
assert f(tuple()) == (tuple(), dict())
- assert f(args) == (args, dict())
- assert f((options,)) == (tuple(), options)
- assert f(args + (options,)) == (args, options)
- assert f((options,) + args) == ((options,) + args, dict())
+ assert f([args]) == (args, dict())
+ assert f([args, options]) == (args, options)
class test_session(object):