On Thu, Sep 17, 2009 at 9:42 AM, Stuart Bishop <[email protected]> wrote: > On Thu, Sep 17, 2009 at 6:03 AM, Guilherme Salgado > <[email protected]> wrote: >> On Wed, 2009-09-16 at 20:02 -0300, Guilherme Salgado wrote: >>> Hi Stuart, >>> >>> That test is failing on my lp:~salgado/launchpad/person-three-o branch >>> because of a new menu Link that is rendered there on the top of the >>> page. We hit the DB in order to figure out whether or not the link >>> should be enabled, and that's when ReadOnlyModeDisallowedStore gets >>> raised. >> >> Here's the failure, btw: http://paste.ubuntu.com/272402/ >> >> -- >> Guilherme Salgado <[email protected]> >> > > File "/var/launchpad/test/lib/canonical/launchpad/database/oauth.py", > line 74, in _get_store > return getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR) > File "/var/launchpad/test/lib/canonical/launchpad/webapp/adapter.py", > line 510, in get > return db_policy.getStore(name, flavor) > File "/var/launchpad/test/lib/canonical/launchpad/webapp/dbpolicy.py", > line 283, in getStore > raise ReadOnlyModeDisallowedStore(name, flavor) > ReadOnlyModeDisallowedStore: ('main', 'master') > > > So you get to line 74 of oauth.py and explicitly request the master > database. Code that needs to run in read only mode can't do that - it > needs to use slave or default stores as the master is down for > maintenance.
So OAuth._get_store needs to be smarter, or you need to stop using the SQLObject compatibility layer in person.py's oauth_tokens method allowing you to choose what store gets used. -- Stuart Bishop <[email protected]> http://www.stuartbishop.net/ _______________________________________________ Mailing list: https://launchpad.net/~launchpad-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-dev More help : https://help.launchpad.net/ListHelp

