server/migractions.py
branchreldefsecurity
changeset 3889 8902b8745918
parent 3877 7ca53fc72a0a
parent 3872 8b1b9179f100
child 3890 d7a270f50f54
equal deleted inserted replaced
3877:7ca53fc72a0a 3889:8902b8745918
   102         """
   102         """
   103         try:
   103         try:
   104             if migrscript.endswith('.sql'):
   104             if migrscript.endswith('.sql'):
   105                 if self.execscript_confirm(migrscript):
   105                 if self.execscript_confirm(migrscript):
   106                     sqlexec(open(migrscript).read(), self.session.system_sql)
   106                     sqlexec(open(migrscript).read(), self.session.system_sql)
   107             else:
   107             elif migrscript.endswith('.py'):
   108                 return super(ServerMigrationHelper, self).cmd_process_script(
   108                 return super(ServerMigrationHelper, self).cmd_process_script(
   109                     migrscript, funcname, *args, **kwargs)
   109                     migrscript, funcname, *args, **kwargs)
       
   110             else:
       
   111                 print
       
   112                 print ('-> ignoring %s, only .py and .sql scripts are considered' %
       
   113                        migrscript)
       
   114                 print
   110             self.commit()
   115             self.commit()
   111         except:
   116         except:
   112             self.rollback()
   117             self.rollback()
   113             raise
   118             raise
   114 
   119