commit 2e455378523d290cca87dc91d2f15020711da4fc Author: Pete Zaitcev Date: Mon Apr 23 19:12:07 2012 -0600 lp:959881 #2 diff --git a/swift/proxy/server.py b/swift/proxy/server.py index ba23e47..724b7be 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -825,6 +825,8 @@ class Controller(object): res.swift_conn = source.swift_conn update_headers(res, source.getheaders()) # Used by container sync feature + if res.environ is None: + res.environ = dict() res.environ['swift_x_timestamp'] = \ source.getheader('x-timestamp') update_headers(res, {'accept-ranges': 'bytes'}) @@ -838,6 +840,8 @@ class Controller(object): res = status_map[source.status](request=req) update_headers(res, source.getheaders()) # Used by container sync feature + if res.environ is None: + res.environ = dict() res.environ['swift_x_timestamp'] = \ source.getheader('x-timestamp') update_headers(res, {'accept-ranges': 'bytes'}) @@ -1160,7 +1164,7 @@ class ObjectController(Controller): try: req.headers['X-Timestamp'] = \ normalize_timestamp(float(req.headers['x-timestamp'])) - if 'swift_x_timestamp' in hresp.environ and \ + if hresp.environ and 'swift_x_timestamp' in hresp.environ and \ float(hresp.environ['swift_x_timestamp']) >= \ float(req.headers['x-timestamp']): return HTTPAccepted(request=req)