From 4278b95aaad9e449d2dd4313e71b9e2c626530ac Mon Sep 17 00:00:00 2001 From: Vitaly Gridnev Date: Tue, 30 Aug 2016 14:35:32 +0300 Subject: [PATCH] improve logging for job execution failure so, if job execution is failed to be submitted, the original exception will not be released back to logs. it's better to use log exception to release exception back to logs Change-Id: I59ea086f8ad945b288eb71b616bc6ee769e0e736 --- sahara/service/edp/job_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sahara/service/edp/job_manager.py b/sahara/service/edp/job_manager.py index 7306c611..095e66b5 100644 --- a/sahara/service/edp/job_manager.py +++ b/sahara/service/edp/job_manager.py @@ -136,8 +136,8 @@ def run_job(job_execution_id): try: _run_job(job_execution_id) except Exception as ex: - LOG.warning( - _LW("Can't run job execution (reason: {reason})").format( + LOG.exception( + _LE("Can't run job execution (reason: {reason})").format( reason=ex)) job_execution = conductor.job_execution_get( @@ -218,8 +218,8 @@ def update_job_status(job_execution_id): try: get_job_status(job_execution_id) except Exception as e: - LOG.error(_LE("Error during update job execution {job}: {error}") - .format(job=job_execution_id, error=e)) + LOG.exception(_LE("Error during update job execution {job}: {error}") + .format(job=job_execution_id, error=e)) def update_job_statuses(cluster_id=None):