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
=== modified file 'lib/canonical/launchpad/webapp/dbpolicy.py'
--- lib/canonical/launchpad/webapp/dbpolicy.py 2009-12-02 11:57:11 +0000
+++ lib/canonical/launchpad/webapp/dbpolicy.py 2009-12-02 19:40:39 +0000
@@ -157,8 +157,10 @@
157 # We need to select a non-load balancing DB policy for +opstats so157 # We need to select a non-load balancing DB policy for +opstats so
158 # it doesn't query the DB for lag information (this page should not158 # it doesn't query the DB for lag information (this page should not
159 # hit the database at all). We haven't traversed yet, so we have159 # hit the database at all). We haven't traversed yet, so we have
160 # to sniff the request this way.160 # to sniff the request this way. Even though PATH_INFO is always
161 if request['PATH_INFO'] == u'/+opstats':161 # present in real requests, we need to tread carefully (``get``) because
162 # of test requests in our automated tests.
163 if request.get('PATH_INFO') == u'/+opstats':
162 return DatabaseBlockedPolicy(request)164 return DatabaseBlockedPolicy(request)
163 elif config.launchpad.read_only:165 elif config.launchpad.read_only:
164 return ReadOnlyLaunchpadDatabasePolicy(request)166 return ReadOnlyLaunchpadDatabasePolicy(request)

Subscribers

People subscribed via source and target branches

to status/vote changes: