server/migractions.py
branchstable
changeset 6042 df9cafb8062c
parent 6035 f8c7aa251782
child 6073 bf684f1022bf
equal deleted inserted replaced
6038:5c5d819e8e93 6042:df9cafb8062c
   116         with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'notification'):
   116         with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'notification'):
   117             super(ServerMigrationHelper, self).migrate(vcconf, toupgrade, options)
   117             super(ServerMigrationHelper, self).migrate(vcconf, toupgrade, options)
   118 
   118 
   119     def cmd_process_script(self, migrscript, funcname=None, *args, **kwargs):
   119     def cmd_process_script(self, migrscript, funcname=None, *args, **kwargs):
   120         try:
   120         try:
   121             super(ServerMigrationHelper, self).cmd_process_script(
   121             return super(ServerMigrationHelper, self).cmd_process_script(
   122                   migrscript, funcname, *args, **kwargs)
   122                   migrscript, funcname, *args, **kwargs)
   123             self.commit()
       
   124         except ExecutionError, err:
   123         except ExecutionError, err:
   125             print >> sys.stderr, "-> %s" % err
   124             print >> sys.stderr, "-> %s" % err
   126         except:
   125         except:
   127             self.rollback()
   126             self.rollback()
   128             raise
   127             raise