Revision 3ccafd0e lib/jqueue.py

b/lib/jqueue.py
574 574
    """
575 575
    return os.path.exists(constants.JOB_QUEUE_DRAIN_FILE)
576 576

  
577
  @staticmethod
578
  def SetDrainFlag(drain_flag):
579
    """Sets the drain flag for the queue.
580

  
581
    This is similar to the function L{backend.JobQueueSetDrainFlag},
582
    and in the future we might merge them.
583

  
584
    """
585
    if drain_flag:
586
      utils.WriteFile(constants.JOB_QUEUE_DRAIN_FILE, data="", close=True)
587
    else:
588
      utils.RemoveFile(constants.JOB_QUEUE_DRAIN_FILE)
589
    return True
590

  
577 591
  @utils.LockedMethod
578 592
  @_RequireOpenQueue
579 593
  def SubmitJob(self, ops):

Also available in: Unified diff