← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/sks-404-msg into lp:launchpad.

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

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/sks-404-msg/+merge/155647

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.
-- 
https://code.launchpad.net/~wgrant/launchpad/sks-404-msg/+merge/155647
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/sks-404-msg into lp:launchpad.
=== modified file 'lib/lp/services/gpg/handler.py'
--- lib/lp/services/gpg/handler.py	2013-01-23 04:12:31 +0000
+++ lib/lp/services/gpg/handler.py	2013-03-27 02:30:33 +0000
@@ -495,7 +495,7 @@
             # into the response's content.
             if exc.code in (404, 500) and exc.fp is not None:
                 content = exc.fp.read()
-                no_key_message = 'Error handling request: No keys found'
+                no_key_message = 'No results found: No keys found'
                 if content.find(no_key_message) >= 0:
                     raise GPGKeyDoesNotExistOnServer(fingerprint)
                 errorlog.globalErrorUtility.raising(sys.exc_info(), request)

=== modified file 'lib/lp/testing/keyserver/tests/test_web.py'
--- lib/lp/testing/keyserver/tests/test_web.py	2013-01-23 06:22:48 +0000
+++ lib/lp/testing/keyserver/tests/test_web.py	2013-03-27 02:30:33 +0000
@@ -98,7 +98,7 @@
             self.assertEqual(
                 '<html><head><title>Error handling request</title></head>\n'
                 '<body><h1>Error handling request</h1>'
-                'Error handling request: No keys found</body></html>',
+                'No results found: No keys found</body></html>',
                 failure.value.response)
 
         d.addCallback(regular_execution_callback)

=== modified file 'lib/lp/testing/keyserver/web.py'
--- lib/lp/testing/keyserver/web.py	2013-01-23 04:12:31 +0000
+++ lib/lp/testing/keyserver/web.py	2013-03-27 02:30:33 +0000
@@ -112,7 +112,7 @@
 
 KEY_NOT_FOUND_BODY = (
     "<html><head><title>Error handling request</title></head>\n"
-    "<body><h1>Error handling request</h1>Error handling request: "
+    "<body><h1>Error handling request</h1>No results found: "
     "No keys found</body></html>")