Revision 686d7433 lib/jqueue.py

b/lib/jqueue.py
564 564

  
565 565
    return [self._LoadJobUnlocked(job_id) for job_id in job_ids]
566 566

  
567
  @staticmethod
568
  def _IsQueueMarkedDrain():
569
    """Check if the queue is marked from drain.
570

  
571
    This currently uses the queue drain file, which makes it a
572
    per-node flag. In the future this can be moved to the config file.
573

  
574
    """
575
    return os.path.exists(constants.JOB_QUEUE_DRAIN_FILE)
576

  
567 577
  @utils.LockedMethod
568 578
  @_RequireOpenQueue
569 579
  def SubmitJob(self, ops):
......
576 586
    @param ops: The list of OpCodes that will become the new job.
577 587

  
578 588
    """
589
    if self._IsQueueMarkedDrain():
590
      raise errors.JobQueueDrainError()
579 591
    # Get job identifier
580 592
    job_id = self._NewSerialUnlocked()
581 593
    job = _QueuedJob(self, job_id, ops)

Also available in: Unified diff