From 2430eb04c0e5b1015fc069f2928e0fa6063959d0 Mon Sep 17 00:00:00 2001 From: Steve Tousignant Date: Wed, 3 Sep 2008 19:29:59 +0000 Subject: Fix for the trouble seen when dooing a database upgrade with sqlite3 backend of django. The backend don't like to have active connection while dooing it's maintenance so the database is closed before dooing the critical step of syncronizing. This is a sqlite quirk that caused the exception : OperationalError: SQL logic error or missing database git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4902 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Reports/updatefix.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/Server') diff --git a/src/lib/Server/Reports/updatefix.py b/src/lib/Server/Reports/updatefix.py index dde330214..25cfc3fe4 100644 --- a/src/lib/Server/Reports/updatefix.py +++ b/src/lib/Server/Reports/updatefix.py @@ -95,6 +95,10 @@ def dosync(): #we should get here if the database is new fresh = True + # ensure database connection are close, so that the management can do it's job right + cursor.close() + connection.close() + # Do the syncdb according to the django version if "call_command" in dir(django.core.management): # this is available since django 1.0 alpha. # not yet tested for full functionnality -- cgit v1.2.3-1-g7c22