diff options
author | Steve Tousignant <stousignant@revolutionlinux.com> | 2008-09-03 19:29:59 +0000 |
---|---|---|
committer | Steve Tousignant <stousignant@revolutionlinux.com> | 2008-09-03 19:29:59 +0000 |
commit | 2430eb04c0e5b1015fc069f2928e0fa6063959d0 (patch) | |
tree | 1b90ba0dd41d12c20c84f7d206128fc4382884b6 /src/lib | |
parent | a5cba4e222f4ef89518bebea9b0ac447730fcdb1 (diff) | |
download | bcfg2-2430eb04c0e5b1015fc069f2928e0fa6063959d0.tar.gz bcfg2-2430eb04c0e5b1015fc069f2928e0fa6063959d0.tar.bz2 bcfg2-2430eb04c0e5b1015fc069f2928e0fa6063959d0.zip |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Reports/updatefix.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |