Merge lp:~gholt/swift/lp837428 into lp:~dweimer/swift/lp837428

Proposed by gholt
Status: Merged
Merged at revision: 350
Proposed branch: lp:~gholt/swift/lp837428
Merge into: lp:~dweimer/swift/lp837428
Diff against target: 36 lines (+6/-2)
2 files modified
swift/proxy/server.py (+3/-2)
test/unit/proxy/test_server.py (+3/-0)
To merge this branch: bzr merge lp:~gholt/swift/lp837428
Reviewer Review Type Date Requested Status
Doug Weimer Pending
Review via email: mp+73439@code.launchpad.net

Description of the change

Adds a unit test and PEP8 fixes.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'swift/proxy/server.py'
--- swift/proxy/server.py 2011-08-30 15:11:26 +0000
+++ swift/proxy/server.py 2011-08-30 20:37:25 +0000
@@ -648,8 +648,9 @@
648 if source:648 if source:
649 ts = float(source.getheader('x-put-timestamp') or649 ts = float(source.getheader('x-put-timestamp') or
650 source.getheader('x-timestamp') or 0)650 source.getheader('x-timestamp') or 0)
651 pts = float(possible_source.getheader('x-put-timestamp') or651 pts = float(
652 possible_source.getheader('x-timestamp') or 0)652 possible_source.getheader('x-put-timestamp') or
653 possible_source.getheader('x-timestamp') or 0)
653 if pts > ts:654 if pts > ts:
654 source = possible_source655 source = possible_source
655 else:656 else:
656657
=== modified file 'test/unit/proxy/test_server.py'
--- test/unit/proxy/test_server.py 2011-08-22 15:22:50 +0000
+++ test/unit/proxy/test_server.py 2011-08-30 20:37:25 +0000
@@ -182,6 +182,8 @@
182 self.etag or '"68b329da9893e34099c7d8ad5cb9c940"',182 self.etag or '"68b329da9893e34099c7d8ad5cb9c940"',
183 'x-works': 'yes',183 'x-works': 'yes',
184 }184 }
185 if not self.timestamp:
186 del headers['x-timestamp']
185 try:187 try:
186 if container_ts_iter.next() is False:188 if container_ts_iter.next() is False:
187 headers['x-container-timestamp'] = '1'189 headers['x-container-timestamp'] = '1'
@@ -1079,6 +1081,7 @@
1079 test_status_map((200, 200, 200), 200, ('1', '3', '2'), '3')1081 test_status_map((200, 200, 200), 200, ('1', '3', '2'), '3')
1080 test_status_map((200, 200, 200), 200, ('1', '3', '1'), '3')1082 test_status_map((200, 200, 200), 200, ('1', '3', '1'), '3')
1081 test_status_map((200, 200, 200), 200, ('3', '3', '1'), '3')1083 test_status_map((200, 200, 200), 200, ('3', '3', '1'), '3')
1084 test_status_map((200, 200, 200), 200, (None, None, None), None)
10821085
1083 def test_GET_newest(self):1086 def test_GET_newest(self):
1084 with save_globals():1087 with save_globals():

Subscribers

People subscribed via source and target branches

to all changes: