Ejemplo n.º 1
0
    def test_failed_to_cancel_job(self, time_get, cluster_get, job_exec_get, job_get, job_execution_update_get):
        info = {"status": edp.JOB_STATUS_RUNNING}

        job, job_exec = u.create_job_exec(edp.JOB_TYPE_PIG, None, False, info)
        job_exec_get.return_value = job_exec
        job_get.return_value = job

        cluster = u.create_cluster()
        cluster.status = c_u.CLUSTER_STATUS_ACTIVE
        cluster_get.return_value = cluster

        time_get.return_value = 10000

        job_execution_update_get.return_value = job_exec

        with testtools.ExpectedException(ex.CancelingFailed):
            job_manager.cancel_job(job_exec.id)
Ejemplo n.º 2
0
    def test_failed_to_cancel_job(self, time_get, cluster_get, job_exec_get,
                                  job_get, job_execution_update_get):
        info = {'status': edp.JOB_STATUS_RUNNING}

        job, job_exec = u.create_job_exec(edp.JOB_TYPE_PIG, None, False, info)
        job_exec_get.return_value = job_exec
        job_get.return_value = job

        cluster = u.create_cluster()
        cluster.status = c_u.CLUSTER_STATUS_ACTIVE
        cluster_get.return_value = cluster

        time_get.return_value = 10000

        job_execution_update_get.return_value = job_exec

        with testtools.ExpectedException(ex.CancelingFailed):
            job_manager.cancel_job(job_exec.id)
Ejemplo n.º 3
0
def _delete_job_execution(job_execution_id):
    try:
        job_execution = job_manager.cancel_job(job_execution_id)
        if not job_execution:
            # job_execution was deleted already, nothing to do
            return
    except exceptions.CancelingFailed:
        LOG.error("Job execution can't be cancelled in time. "
                  "Deleting it anyway.")
    conductor.job_execution_destroy(context.ctx(), job_execution_id)
Ejemplo n.º 4
0
def _delete_job_execution(job_execution_id):
    try:
        job_execution = job_manager.cancel_job(job_execution_id)
        if not job_execution:
            # job_execution was deleted already, nothing to do
            return
    except exceptions.CancelingFailed:
        LOG.error("Job execution can't be cancelled in time. "
                  "Deleting it anyway.")
    conductor.job_execution_destroy(context.ctx(), job_execution_id)
Ejemplo n.º 5
0
def _cancel_job_execution(job_execution_id):
    job_manager.cancel_job(job_execution_id)
Ejemplo n.º 6
0
def _cancel_job_execution(job_execution_id):
    job_manager.cancel_job(job_execution_id)
Ejemplo n.º 7
0
def cancel_job_execution(id):
    return manager.cancel_job(id)
Ejemplo n.º 8
0
Archivo: api.py Proyecto: viplav/sahara
def cancel_job_execution(id):
    return manager.cancel_job(id)