diff options
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/Reports/updatefix.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/updatefix.py b/src/lib/Bcfg2/Server/Reports/updatefix.py index 39fc10b56..d02e88b1a 100644 --- a/src/lib/Bcfg2/Server/Reports/updatefix.py +++ b/src/lib/Bcfg2/Server/Reports/updatefix.py @@ -67,9 +67,15 @@ def _remove_table_column(tbl, col): cursor.execute('alter table %s ' 'drop column %s;' % (tbl, col)) except DatabaseError: + # check if table exists + try: + cursor.execute('select * from sqlite_master where name=%s and type="table";' % tbl) + except DatabaseError: + # table doesn't exist + return + # sqlite wants us to create a new table containing the columns we want # and copy into it http://www.sqlite.org/faq.html#q11 - tmptbl_name = "t_backup" _tmptbl_create = \ """create temporary table "%s" ( |