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
1=== modified file 'swift/proxy/server.py'
2--- swift/proxy/server.py 2011-08-30 15:11:26 +0000
3+++ swift/proxy/server.py 2011-08-30 20:37:25 +0000
4@@ -648,8 +648,9 @@
5 if source:
6 ts = float(source.getheader('x-put-timestamp') or
7 source.getheader('x-timestamp') or 0)
8- pts = float(possible_source.getheader('x-put-timestamp') or
9- possible_source.getheader('x-timestamp') or 0)
10+ pts = float(
11+ possible_source.getheader('x-put-timestamp') or
12+ possible_source.getheader('x-timestamp') or 0)
13 if pts > ts:
14 source = possible_source
15 else:
16
17=== modified file 'test/unit/proxy/test_server.py'
18--- test/unit/proxy/test_server.py 2011-08-22 15:22:50 +0000
19+++ test/unit/proxy/test_server.py 2011-08-30 20:37:25 +0000
20@@ -182,6 +182,8 @@
21 self.etag or '"68b329da9893e34099c7d8ad5cb9c940"',
22 'x-works': 'yes',
23 }
24+ if not self.timestamp:
25+ del headers['x-timestamp']
26 try:
27 if container_ts_iter.next() is False:
28 headers['x-container-timestamp'] = '1'
29@@ -1079,6 +1081,7 @@
30 test_status_map((200, 200, 200), 200, ('1', '3', '2'), '3')
31 test_status_map((200, 200, 200), 200, ('1', '3', '1'), '3')
32 test_status_map((200, 200, 200), 200, ('3', '3', '1'), '3')
33+ test_status_map((200, 200, 200), 200, (None, None, None), None)
34
35 def test_GET_newest(self):
36 with save_globals():

Subscribers

People subscribed via source and target branches

to all changes: