Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
b86dbff2
Commit
b86dbff2
authored
Oct 19, 2017
by
Łukasz Nowak
Committed by
Klaus Wölfel
Aug 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[taskdistribution] Drop needless TaskDistributionTool
There is no need for any client to call tool directly.
parent
c20f70a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
56 deletions
+1
-56
erp5/util/taskdistribution/__init__.py
erp5/util/taskdistribution/__init__.py
+1
-56
No files found.
erp5/util/taskdistribution/__init__.py
View file @
b86dbff2
...
@@ -47,7 +47,7 @@ import threading
...
@@ -47,7 +47,7 @@ import threading
import
time
import
time
import
xmlrpclib
import
xmlrpclib
__all__
=
[
'TaskDistribut
ionTool
'
,
'TestResultProxy'
,
'TestResultLineProxy'
,
'patchRPCParser'
]
__all__
=
[
'TaskDistribut
or
'
,
'TestResultProxy'
,
'TestResultLineProxy'
,
'patchRPCParser'
]
# Depending on used xmlrpc backend, different exceptions can be thrown.
# Depending on used xmlrpc backend, different exceptions can be thrown.
SAFE_RPC_EXCEPTION_LIST
=
[
socket
.
error
,
xmlrpclib
.
ProtocolError
,
SAFE_RPC_EXCEPTION_LIST
=
[
socket
.
error
,
xmlrpclib
.
ProtocolError
,
...
@@ -407,61 +407,6 @@ class ServerProxy(xmlrpclib.ServerProxy):
...
@@ -407,61 +407,6 @@ class ServerProxy(xmlrpclib.ServerProxy):
with
self
.
__rpc_lock
:
with
self
.
__rpc_lock
:
return
xmlrpclib
.
ServerProxy
.
__request
(
self
,
*
args
,
**
kw
)
return
xmlrpclib
.
ServerProxy
.
__request
(
self
,
*
args
,
**
kw
)
class
TaskDistributionTool
(
RPCRetry
):
def
__init__
(
self
,
portal_url
,
retry_time
=
64
,
logger
=
None
):
"""
portal_url (str, None)
Portal URL of ERP5 site to use as a task distributor.
If None, single node setup is assumed.
"""
if
logger
is
None
:
logger
=
null_logger
if
portal_url
is
None
:
proxy
=
DummyTaskDistributionTool
()
else
:
proxy
=
ServerProxy
(
portal_url
,
allow_none
=
True
,
).
portal_task_distribution
super
(
TaskDistributionTool
,
self
).
__init__
(
proxy
,
retry_time
,
logger
)
protocol_revision
=
self
.
_retryRPC
(
'getProtocolRevision'
)
if
protocol_revision
!=
1
:
raise
ValueError
(
'Unsupported protocol revision: %r'
,
protocol_revision
)
def
createTestResult
(
self
,
revision
,
test_name_list
,
node_title
,
allow_restart
=
False
,
test_title
=
None
,
project_title
=
None
):
"""
(maybe) create a new test run.
revision (str)
An opaque string describing code being tested.
test_name_list (list of str)
List of tests being part of this test run. May be empty.
node_title (str)
Human-readable test node identifier, so an adnmin can know which
node does what.
allow_restart (bool)
When true, a tet result is always created, even if a former finished
one is found for same name and revision pair.
test_title (str)
Human-readable title for test. Must be identical for successive runs.
Allows browsing its result history.
project_title (str)
Existing project title, so test result gets associated to it.
Returns None if no test run is needed (a test run for given name and
revision has already been completed).
Otherwise, returns a TestResultProxy instance.
"""
result
=
self
.
_retryRPC
(
'createTestResult'
,
(
''
,
revision
,
test_name_list
,
allow_restart
,
test_title
,
node_title
,
project_title
))
if
result
:
test_result_path
,
revision
=
result
result
=
TestResultProxy
(
self
.
_proxy
,
self
.
_retry_time
,
self
.
_logger
,
test_result_path
,
node_title
,
revision
)
return
result
class
TaskDistributor
(
RPCRetry
):
class
TaskDistributor
(
RPCRetry
):
def
__init__
(
self
,
portal_url
,
retry_time
=
64
,
logger
=
None
):
def
__init__
(
self
,
portal_url
,
retry_time
=
64
,
logger
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment