Commit c4102d17 authored by Vincent Pelletier's avatar Vincent Pelletier

xmlrpclib does not support named parameters, use positional ones

parent ee536d37
No related merge requests found
Changes Changes
======= =======
0.4.4 (2012-07-XX) 0.4.5 (2012-07-04)
------------------
* erp5.util.taskdistribution:
- xmlrpclib does not support named parameters, use positional ones
[Vincent Pelletier]
0.4.4 (2012-07-04)
------------------ ------------------
* erp5.util.taskdistribution: * erp5.util.taskdistribution:
......
...@@ -102,18 +102,18 @@ class RPCRetry(object): ...@@ -102,18 +102,18 @@ class RPCRetry(object):
self._logger = logger self._logger = logger
self.__rpc_lock = threading.Lock() self.__rpc_lock = threading.Lock()
def _RPC(self, func_id, args=(), kw={}): def _RPC(self, func_id, args=()):
with self.__rpc_lock: with self.__rpc_lock:
return getattr(self._proxy, func_id)(*args, **kw) return getattr(self._proxy, func_id)(*args)
def _retryRPC(self, func_id, args=(), kw={}): def _retryRPC(self, func_id, args=()):
retry_time = self._retry_time retry_time = self._retry_time
while True: while True:
try: try:
return self._RPC(func_id, args, kw) return self._RPC(func_id, args)
except SAFE_RPC_EXCEPTION_LIST: except SAFE_RPC_EXCEPTION_LIST:
self._logger.warning('Got exception, retrying: %s(*%r, **%r) ' self._logger.warning('Got exception, retrying: %s%r '
'in %is', func_id, args, kw, retry_time, exc_info=1) 'in %is', func_id, tuple(args), retry_time, exc_info=1)
time.sleep(retry_time) time.sleep(retry_time)
retry_time *= 1.5 retry_time *= 1.5
...@@ -396,15 +396,9 @@ class TaskDistributionTool(RPCRetry): ...@@ -396,15 +396,9 @@ class TaskDistributionTool(RPCRetry):
revision has already been completed). revision has already been completed).
Otherwise, returns a TestResultProxy instance. Otherwise, returns a TestResultProxy instance.
""" """
result = self._retryRPC('createTestResult', kw={ result = self._retryRPC('createTestResult', ('', revision,
'name': '', test_name_list, allow_restart, test_title, node_title,
'revision': revision, project_title))
'test_name_list': test_name_list,
'allow_restart': allow_restart,
'test_title': test_title,
'node_title': node_title,
'project_title': project_title,
})
if result: if result:
test_result_path, revision = result test_result_path, revision = result
result = TestResultProxy(self._proxy, self._retry_time, result = TestResultProxy(self._proxy, self._retry_time,
...@@ -428,7 +422,7 @@ class DummyTaskDistributionTool(object): ...@@ -428,7 +422,7 @@ class DummyTaskDistributionTool(object):
def getProtocolRevision(self): def getProtocolRevision(self):
return 1 return 1
def createTestResult(self, name, revision, test_name_list, *args, **kw): def createTestResult(self, name, revision, test_name_list, *args):
self.test_name_list = test_name_list[:] self.test_name_list = test_name_list[:]
return None, revision return None, revision
...@@ -439,11 +433,11 @@ class DummyTaskDistributionTool(object): ...@@ -439,11 +433,11 @@ class DummyTaskDistributionTool(object):
del self.test_name_list[i] del self.test_name_list[i]
return None, test return None, test
def stopUnitTest(self, *args, **kw): def stopUnitTest(self, *args):
pass pass
reportTaskFailure = reportTaskStatus = stopUnitTest reportTaskFailure = reportTaskStatus = stopUnitTest
def isTaskAlive(self, *args, **kw): def isTaskAlive(self, *args):
return int(bool(self.test_name_list)) return int(bool(self.test_name_list))
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import glob import glob
import os import os
version = '0.4.4' version = '0.4.5'
name = 'erp5.util' name = 'erp5.util'
long_description = open("README.erp5.util.txt").read() + "\n" long_description = open("README.erp5.util.txt").read() + "\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment