Revision 0f9c08dc

b/lib/jqueue.py
1046 1046

  
1047 1047
    return [self._LoadJobUnlocked(job_id) for job_id in job_ids]
1048 1048

  
1049
  def SafeLoadJobFromDisk(self, job_id):
1050
    """Load the given job file from disk.
1051

  
1052
    Given a job file, read, load and restore it in a _QueuedJob format.
1053
    In case of error reading the job, it gets returned as None, and the
1054
    exception is logged.
1055

  
1056
    @type job_id: string
1057
    @param job_id: job identifier
1058
    @rtype: L{_QueuedJob} or None
1059
    @return: either None or the job object
1060

  
1061
    """
1062
    try:
1063
      return self._LoadJobFromDisk(job_id)
1064
    except (errors.JobFileCorrupted, EnvironmentError):
1065
      logging.exception("Can't load/parse job %s", job_id)
1066
      return None
1067

  
1049 1068
  @staticmethod
1050 1069
  def _IsQueueMarkedDrain():
1051 1070
    """Check if the queue is marked from drain.

Also available in: Unified diff