summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2010-11-02 19:39:24 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2010-11-02 19:42:04 -0500
commit6079a4b01ee4d500fb79cd5552f00e987ed65485 (patch)
tree2869b8e9984bf661bc540fedb8764d6556b17bfb
parent53a383ab2afcbcac748b5387cbfb786feb5f7acf (diff)
downloadbcfg2-6079a4b01ee4d500fb79cd5552f00e987ed65485.tar.gz
bcfg2-6079a4b01ee4d500fb79cd5552f00e987ed65485.tar.bz2
bcfg2-6079a4b01ee4d500fb79cd5552f00e987ed65485.zip
reports: fix bcfg2-admin reports init when db is nonexistent
(cherry picked from commit feed7f02aeda0b8abe4a3a521e6ab13081c84232)
-rw-r--r--src/lib/Server/Reports/updatefix.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Server/Reports/updatefix.py b/src/lib/Server/Reports/updatefix.py
index 6d9b5e952..f8fca1f90 100644
--- a/src/lib/Server/Reports/updatefix.py
+++ b/src/lib/Server/Reports/updatefix.py
@@ -139,8 +139,12 @@ def dosync():
fresh = True
# ensure database connection are close, so that the management can do it's job right
- cursor.close()
- connection.close()
+ try:
+ cursor.close()
+ connection.close()
+ except:
+ # ignore any errors from missing/invalid dbs
+ pass
# Do the syncdb according to the django version
if "call_command" in dir(django.core.management):
# this is available since django 1.0 alpha.