예제 #1
0
    def start(self):
        from backend.tasks import ExecutionTask

        ExecutionTask().delay(execution_id=self.id)
        EventDispatcher.trigger(
            ExecutionStart(self.environment.application.department.id,
                           execution=self))
예제 #2
0
파일: tasks.py 프로젝트: EzanLTD/gunnery
 def finalize(self, execution, execution_id):
     """ Trigger event, and save live log
     """
     department_id = execution.environment.application.department.id
     EventDispatcher.trigger(ExecutionFinish(department_id, execution=execution))
     ExecutionLiveLog.add(execution_id, 'execution_completed',
                          status=execution.status,
                          time_end=execution.time_end,
                          time=execution.time)
예제 #3
0
 def finalize(self, execution, execution_id):
     """ Trigger event, and save live log
     """
     department_id = execution.environment.application.department.id
     EventDispatcher.trigger(
         ExecutionFinish(department_id, execution=execution))
     ExecutionLiveLog.add(execution_id,
                          'execution_completed',
                          status=execution.status,
                          time_end=execution.time_end,
                          time=execution.time)
예제 #4
0
    def run(self, execution_id):
        execution = self._get_execution(execution_id)

        if execution.status != Execution.ABORTED:
            failed = False
            for command in execution.commands.all():
                for server in command.servers.all():
                    if server.status in [None, server.FAILED]:
                        failed = True
            if failed:
                execution.status = execution.FAILED
            else:
                execution.status = execution.SUCCESS
            execution.save_end()

        department_id = execution.environment.application.department.id
        EventDispatcher.trigger(ExecutionFinish(department_id, execution=execution))
        ExecutionLiveLog.add(execution_id, 'execution_completed',
                             status=execution.status,
                             time_end=execution.time_end,
                             time=execution.time)
예제 #5
0
파일: models.py 프로젝트: EzanLTD/gunnery
    def start(self):
        from backend.tasks import ExecutionTask

        ExecutionTask().delay(execution_id=self.id)
        EventDispatcher.trigger(ExecutionStart(self.environment.application.department.id, execution=self))