Merge lp:~gary/launchpad/opstats-nodb into lp:launchpad/db-devel

Proposed by Gary Poster
Status: Merged
Approved by: Edwin Grubbs
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~gary/launchpad/opstats-nodb
Merge into: lp:launchpad/db-devel
Diff against target: 16 lines (+4/-2)
1 file modified
lib/canonical/launchpad/webapp/dbpolicy.py (+4/-2)
To merge this branch: bzr merge lp:~gary/launchpad/opstats-nodb
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+15569@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

This branch fixes the errors shown in the recent buildbot run for db-devel (https://lpbuildbot.canonical.com/builders/db_lp/builds/313/steps/shell_7/logs/summary).

The comment additions hopefully explain the purpose of the changes.

To test the formerly failing tests, use this command:

./bin/test -vv -ttest_other_request_uses_LaunchpadDatabasePolicy -ttest_read_only_mode_uses_ReadOnlyLaunchpadDatabasePolicy -twebapp-publication.txt

To test the pertinent test that stub added for this code, run this command:

./bin/test -vvtxx-opstats.txt

Thank you

Gary

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

merge-approved

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/dbpolicy.py'
2--- lib/canonical/launchpad/webapp/dbpolicy.py 2009-12-02 11:57:11 +0000
3+++ lib/canonical/launchpad/webapp/dbpolicy.py 2009-12-02 19:40:39 +0000
4@@ -157,8 +157,10 @@
5 # We need to select a non-load balancing DB policy for +opstats so
6 # it doesn't query the DB for lag information (this page should not
7 # hit the database at all). We haven't traversed yet, so we have
8- # to sniff the request this way.
9- if request['PATH_INFO'] == u'/+opstats':
10+ # to sniff the request this way. Even though PATH_INFO is always
11+ # present in real requests, we need to tread carefully (``get``) because
12+ # of test requests in our automated tests.
13+ if request.get('PATH_INFO') == u'/+opstats':
14 return DatabaseBlockedPolicy(request)
15 elif config.launchpad.read_only:
16 return ReadOnlyLaunchpadDatabasePolicy(request)

Subscribers

People subscribed via source and target branches

to status/vote changes: