From 96c13fcf9c9b2de0e3a89a794e2ea26a0226a24c Mon Sep 17 00:00:00 2001 From: showard Date: Fri, 29 May 2009 18:41:18 +0000 Subject: make the readonly connection fallback to the regular Django connection when running in the scheduer. this is really important, because otherwise the readonly connection is not autocommit and bad, bad things could happen, though i'm not sure exactly what existing problems there might have been. we used to do this only for testing, but since we do it in another context here, i renamed the method to be more generic and appropriate. Signed-off-by: Steve Howard git-svn-id: svn://test.kernel.org/autotest/trunk@3183 592f7852-d20e-0410-864c-8624ca9c26a4 --- scheduler/monitor_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scheduler') diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py index 64dcdc5e..3c9948ef 100755 --- a/scheduler/monitor_db.py +++ b/scheduler/monitor_db.py @@ -14,7 +14,7 @@ from autotest_lib.frontend import setup_django_environment from autotest_lib.client.common_lib import global_config from autotest_lib.client.common_lib import host_protections, utils from autotest_lib.database import database_connection -from autotest_lib.frontend.afe import models, rpc_utils +from autotest_lib.frontend.afe import models, rpc_utils, readonly_connection from autotest_lib.scheduler import drone_manager, drones, email_manager from autotest_lib.scheduler import monitor_db_cleanup from autotest_lib.scheduler import status_server, scheduler_config @@ -196,6 +196,8 @@ def init(logfile): # ensure Django connection is in autocommit setup_django_environment.enable_autocommit() + # bypass the readonly connection + readonly_connection.ReadOnlyConnection.set_globally_disabled(True) logging.info("Setting signal handler") signal.signal(signal.SIGINT, handle_sigint) -- cgit v1.2.3