Keep it simple

Do not check original status response before
updating container meta.
This commit is contained in:
Fabien Boucher
2013-04-03 10:12:18 +02:00
parent f8593c20aa
commit cf77fbab83

View File

@@ -18,7 +18,6 @@
import time
from swift.common.utils import get_logger
from swift.common.http import is_success
from swift.common.swob import wsgify
from swift.common.wsgi import make_pre_authed_request
@@ -74,14 +73,10 @@ class LastModifiedMiddleware(object):
if (req.method in ('POST', 'PUT') and
container or req.method == 'DELETE' and obj):
new_env = req.environ.copy()
# Keep it simple and do not check original request
# response status before updating the container meta
user_resp = self.req_passthrough(req)
if is_success(user_resp.status_int):
# Update Container Meta Last-Modified in case of
# successful request
update_resp = self.update_last_modified_meta(req,
new_env)
if is_success(update_resp.status_int):
self.logger.info('Unable to update Meta Last-Modified')
self.update_last_modified_meta(req, new_env)
return user_resp
return self.app