diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2010-11-02 19:39:24 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-11-02 20:32:34 -0500 |
commit | 5fe38f0054cf392829b69961b864f284e34057f4 (patch) | |
tree | 5c7d39abd38466177bf24a8806789a4c781767ac | |
parent | e2b8d674fe5a38906fcd07e760303178e2fe5c30 (diff) | |
download | bcfg2-5fe38f0054cf392829b69961b864f284e34057f4.tar.gz bcfg2-5fe38f0054cf392829b69961b864f284e34057f4.tar.bz2 bcfg2-5fe38f0054cf392829b69961b864f284e34057f4.zip |
reports: fix bcfg2-admin reports init when db is nonexistent
(cherry picked from commit feed7f02aeda0b8abe4a3a521e6ab13081c84232)
-rw-r--r-- | src/lib/Server/Reports/updatefix.py | 8 |
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. |