eventlet.posthook related code needn't anymore
In the past, older Swift seemed to use eventlet.posthooks scheme for the logging on proxy with posthooklogger method. However, for now, Swift attaches no method to eventlet.posthooks everywhere so we don't have to maintain the posthooks anymore. Change-Id: Ie63941a202d448532d980252a4d25575f8edab9c
This commit is contained in:
@@ -1084,8 +1084,8 @@ def make_env(env, method=None, path=None, agent='Swift', query_string=None,
|
||||
:returns: Fresh WSGI environment.
|
||||
"""
|
||||
newenv = {}
|
||||
for name in ('eventlet.posthooks', 'HTTP_USER_AGENT', 'HTTP_HOST',
|
||||
'PATH_INFO', 'QUERY_STRING', 'REMOTE_USER', 'REQUEST_METHOD',
|
||||
for name in ('HTTP_USER_AGENT', 'HTTP_HOST', 'PATH_INFO',
|
||||
'QUERY_STRING', 'REMOTE_USER', 'REQUEST_METHOD',
|
||||
'SCRIPT_NAME', 'SERVER_NAME', 'SERVER_PORT',
|
||||
'HTTP_ORIGIN', 'HTTP_ACCESS_CONTROL_REQUEST_METHOD',
|
||||
'SERVER_PROTOCOL', 'swift.cache', 'swift.source',
|
||||
|
||||
@@ -818,6 +818,13 @@ class BaseObjectController(Controller):
|
||||
self.object_name = dest_object
|
||||
# re-write the existing request as a PUT instead of creating a new one
|
||||
# since this one is already attached to the posthooklogger
|
||||
# TODO: Swift now has proxy-logging middleware instead of
|
||||
# posthooklogger used in before. i.e. we don't have to
|
||||
# keep the code depends on evnetlet.posthooks sequence, IMHO.
|
||||
# However, creating a new sub request might
|
||||
# cause the possibility to hide some bugs behindes the request
|
||||
# so that we should discuss whichi is suitable (new-sub-request
|
||||
# vs re-write-existing-request) for Swift. [kota_]
|
||||
req.method = 'PUT'
|
||||
req.path_info = '/v1/%s/%s/%s' % \
|
||||
(dest_account, dest_container, dest_object)
|
||||
|
||||
Reference in New Issue
Block a user