[migration] avoid AssertionError / crashes if migration script is neither a py nor a sql file stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 18 Nov 2009 10:05:41 +0100
branchstable
changeset 3872 8b1b9179f100
parent 3871 983acb2b303b
child 3873 4d95109582c7
[migration] avoid AssertionError / crashes if migration script is neither a py nor a sql file
server/migractions.py
--- a/server/migractions.py	Tue Nov 17 11:48:36 2009 +0100
+++ b/server/migractions.py	Wed Nov 18 10:05:41 2009 +0100
@@ -104,9 +104,14 @@
             if migrscript.endswith('.sql'):
                 if self.execscript_confirm(migrscript):
                     sqlexec(open(migrscript).read(), self.session.system_sql)
-            else:
+            elif migrscript.endswith('.py'):
                 return super(ServerMigrationHelper, self).cmd_process_script(
                     migrscript, funcname, *args, **kwargs)
+            else:
+                print
+                print ('-> ignoring %s, only .py and .sql scripts are considered' %
+                       migrscript)
+                print
             self.commit()
         except:
             self.rollback()