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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
ac31e8c9
Commit
ac31e8c9
authored
Sep 12, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimerService: silent NotFound errors when the service is not created yet
Unlike Medusa, WSGI does not do it.
parent
6f9b579d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
product/TimerService/timerserver/TimerServer.py
product/TimerService/timerserver/TimerServer.py
+19
-11
No files found.
product/TimerService/timerserver/TimerServer.py
View file @
ac31e8c9
...
...
@@ -9,6 +9,7 @@ import thread
import
re
import
sys
,
os
,
errno
,
time
,
socket
from
functools
import
partial
from
urlparse
import
urlsplit
from
StringIO
import
StringIO
from
zLOG
import
LOG
,
INFO
...
...
@@ -123,6 +124,19 @@ class TimerServer:
pass
TIMER_SERVICE_PATH
=
'/Control_Panel/timer_service'
TIMER_ENVIRON
=
{
'REQUEST_METHOD'
:
'GET'
,
'SERVER_SOFTWARE'
:
'TimerServer for Zope'
,
'SERVER_NAME'
:
''
,
'SERVER_PORT'
:
''
,
'REMOTE_ADDR'
:
''
,
'GATEWAY_INTERFACE'
:
'CGI/1.1'
,
'SERVER_PROTOCOL'
:
'HTTP/1.0'
,
'PATH_INFO'
:
TIMER_SERVICE_PATH
+
'/process_timer'
,
}
class
TimerResponse
(
BaseResponse
):
after_list
=
()
...
...
@@ -158,6 +172,10 @@ class TimerResponse(BaseResponse):
# Use the default character encoding
return
body
.
encode
(
ZPublisher
.
HTTPResponse
.
default_encoding
,
'replace'
)
def
notFoundError
(
self
,
url
):
assert
urlsplit
(
url
).
path
==
TIMER_SERVICE_PATH
,
url
return
lambda
:
None
class
TimerRequest
(
HTTPRequest
):
...
...
@@ -172,17 +190,7 @@ class TimerRequest(HTTPRequest):
def
_get_env
(
self
,
stdin
):
"Returns a CGI style environment"
env
=
{}
env
[
'REQUEST_METHOD'
]
=
'GET'
env
[
'SERVER_SOFTWARE'
]
=
'TimerServer for Zope'
env
[
'SERVER_NAME'
]
=
''
env
[
'SERVER_PORT'
]
=
''
env
[
'REMOTE_ADDR'
]
=
''
env
[
'GATEWAY_INTERFACE'
]
=
'CGI/1.1'
env
[
'SERVER_PROTOCOL'
]
=
'HTTP/1.0'
env
[
'PATH_INFO'
]
=
'/Control_Panel/timer_service/process_timer'
return
env
return
TIMER_ENVIRON
.
copy
()
def
clone
(
self
):
# This method is a dumb copy of Zope-2.8's one that makes timerserver
...
...
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