Merge lp:~wgrant/launchpad/sks-404-msg into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 16543
Proposed branch: lp:~wgrant/launchpad/sks-404-msg
Merge into: lp:launchpad
Diff against target: 36 lines (+3/-3)
3 files modified
lib/lp/services/gpg/handler.py (+1/-1)
lib/lp/testing/keyserver/tests/test_web.py (+1/-1)
lib/lp/testing/keyserver/web.py (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/sks-404-msg
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+155647@code.launchpad.net

Commit message

Update SKS error message check to match production, fixing soft OOPSes on missing keys.

Description of the change

Update the SKS 404 error message to match the new production version. The page won't crash with the existing code, but a soft OOPS is raised.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/gpg/handler.py'
2--- lib/lp/services/gpg/handler.py 2013-01-23 04:12:31 +0000
3+++ lib/lp/services/gpg/handler.py 2013-03-27 02:30:33 +0000
4@@ -495,7 +495,7 @@
5 # into the response's content.
6 if exc.code in (404, 500) and exc.fp is not None:
7 content = exc.fp.read()
8- no_key_message = 'Error handling request: No keys found'
9+ no_key_message = 'No results found: No keys found'
10 if content.find(no_key_message) >= 0:
11 raise GPGKeyDoesNotExistOnServer(fingerprint)
12 errorlog.globalErrorUtility.raising(sys.exc_info(), request)
13
14=== modified file 'lib/lp/testing/keyserver/tests/test_web.py'
15--- lib/lp/testing/keyserver/tests/test_web.py 2013-01-23 06:22:48 +0000
16+++ lib/lp/testing/keyserver/tests/test_web.py 2013-03-27 02:30:33 +0000
17@@ -98,7 +98,7 @@
18 self.assertEqual(
19 '<html><head><title>Error handling request</title></head>\n'
20 '<body><h1>Error handling request</h1>'
21- 'Error handling request: No keys found</body></html>',
22+ 'No results found: No keys found</body></html>',
23 failure.value.response)
24
25 d.addCallback(regular_execution_callback)
26
27=== modified file 'lib/lp/testing/keyserver/web.py'
28--- lib/lp/testing/keyserver/web.py 2013-01-23 04:12:31 +0000
29+++ lib/lp/testing/keyserver/web.py 2013-03-27 02:30:33 +0000
30@@ -112,7 +112,7 @@
31
32 KEY_NOT_FOUND_BODY = (
33 "<html><head><title>Error handling request</title></head>\n"
34- "<body><h1>Error handling request</h1>Error handling request: "
35+ "<body><h1>Error handling request</h1>No results found: "
36 "No keys found</body></html>")
37
38