summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-11-07 18:23:48 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-11-07 18:23:48 +0000
commit8ed77dae7a11ddfcf2b028686efa9573516d9f85 (patch)
tree6ff3c3e1395b0e1c010d827cc3636e8569031ef1 /src/lib
parentc3b0e2a3cf995099af1ffedf4c1ef2369ce1df7e (diff)
downloadbcfg2-8ed77dae7a11ddfcf2b028686efa9573516d9f85.tar.gz
bcfg2-8ed77dae7a11ddfcf2b028686efa9573516d9f85.tar.bz2
bcfg2-8ed77dae7a11ddfcf2b028686efa9573516d9f85.zip
Improve error handling around schema auto-update code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4968 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Reports/updatefix.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/Server/Reports/updatefix.py b/src/lib/Server/Reports/updatefix.py
index 25cfc3fe4..f3679892e 100644
--- a/src/lib/Server/Reports/updatefix.py
+++ b/src/lib/Server/Reports/updatefix.py
@@ -71,10 +71,14 @@ def rollupdate(current_version):
"""
if current_version < lastversion:
for i in range(current_version, lastversion):
- if type(_fixes[i]) == str:
- connection.cursor().execute(_fixes[i])
- else:
- _fixes[i]()
+ try:
+ if type(_fixes[i]) == str:
+ connection.cursor().execute(_fixes[i])
+ else:
+ _fixes[i]()
+ except:
+ logger.error("Failed to perform db update %s" % (_fixes[i]), exc_info=1)
+ continue
# since array start at 0 but version start at 1 we add 1 to the normal count
ret = InternalDatabaseVersion.objects.create(version=i+1)
return ret