From a1a26de1728e5a64216bd660193179944e2a766a Mon Sep 17 00:00:00 2001 From: luhuichun Date: Mon, 7 Dec 2015 12:11:01 +0800 Subject: [PATCH] Add log when directly return from cancel_job If directly return from cancel_job in job_manager, we should log why sahara directly return other than keep running this method. Change-Id: I1836274d7965a6e6a52fb37061c50d5461f469e1 --- sahara/service/edp/job_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sahara/service/edp/job_manager.py b/sahara/service/edp/job_manager.py index e36081dc..4bd1b879 100644 --- a/sahara/service/edp/job_manager.py +++ b/sahara/service/edp/job_manager.py @@ -147,9 +147,12 @@ def cancel_job(job_execution_id): ctx = context.ctx() job_execution = conductor.job_execution_get(ctx, job_execution_id) if job_execution.info['status'] in edp.JOB_STATUSES_TERMINATED: + LOG.info(_LI("Job execution is already finished and shouldn't be" + " canceled")) return job_execution cluster = conductor.cluster_get(ctx, job_execution.cluster_id) if cluster is None: + LOG.info(_LI("Can not cancel this job on a non-existant cluster.")) return job_execution engine = _get_job_engine(cluster, job_execution) if engine is not None: