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:39:24 -0500
commitfeed7f02aeda0b8abe4a3a521e6ab13081c84232 (patch)
tree2d51cc99bbd088f68357365a7e251290ccb093e4
parentb7ebe51fbd178e0e20b009cfe4f9d4a7fd352aed (diff)
downloadbcfg2-feed7f02aeda0b8abe4a3a521e6ab13081c84232.tar.gz
bcfg2-feed7f02aeda0b8abe4a3a521e6ab13081c84232.tar.bz2
bcfg2-feed7f02aeda0b8abe4a3a521e6ab13081c84232.zip
reports: fix bcfg2-admin reports init when db is nonexistent
-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.