ticket:943: 0001-BibSched-set-ERROR-status-when-wrong-params.patch

File 0001-BibSched-set-ERROR-status-when-wrong-params.patch, 1.6 KB (added by skaplun, 2 years ago)
  • modules/bibsched/lib/bibtask.py

    From d918585ad78d4551726f1803a1b369c15d840936 Mon Sep 17 00:00:00 2001
    From: Samuele Kaplun <samuele.kaplun@cern.ch>
    Date: Wed, 14 Mar 2012 09:40:48 +0100
    Subject: [PATCH] BibSched: set ERROR status when wrong params
    
    * If a task has been scheduled via task_low_level_submission,
      it might contain some wrong command line arguments that would
      be spot only at execution time. In case of errors, the task
      will now be set to "ERROR" status, instead of staying in
      "SCHEDULED" status.
      (closes #943)
    ---
     modules/bibsched/lib/bibtask.py |   10 ++++------
     1 files changed, 4 insertions(+), 6 deletions(-)
    
    diff --git a/modules/bibsched/lib/bibtask.py b/modules/bibsched/lib/bibtask.py
    index 95c4c9c..46d94b1 100644
    a b def task_init( 
    335335                help_specific_usage, version, specific_params, 
    336336                task_submit_elaborate_specific_parameter_fnc, 
    337337                task_submit_check_options_fnc) 
    338         except SystemExit: 
    339             raise 
    340         except Exception, e: 
    341             register_exception(alert_admin=True) 
    342             write_message("Error in parsing the parameters: %s." % e, sys.stderr) 
    343             write_message("Exiting.", sys.stderr) 
     338        except (SystemExit, Exception), err: 
    344339            if not to_be_submitted: 
     340                register_exception(alert_admin=True) 
     341                write_message("Error in parsing the parameters: %s." % err, sys.stderr) 
     342                write_message("Exiting.", sys.stderr) 
    345343                task_update_status("ERROR") 
    346344            raise 
    347345