Esempio n. 1
0
 def get_next_to_finish(self, node=None):
     """Return the most recent run which is either running or scheduled. If
     node is not None, then only looks for runs on that node.
     """
     return next_or_none(
         r for r in self.runs if (not node or r.node == node) and
         (r.is_running or r.is_scheduled)
     )
Esempio n. 2
0
 def get_first_queued(self, node=None):
     return next_or_none(
         r for r in reversed(self.runs)
         if (not node or r.node == node) and r.state == ActionRun.QUEUED)
Esempio n. 3
0
 def get_newest(self, include_manual=True):
     """Returns the most recently created JobRun."""
     return next_or_none(r for r in self.runs
                         if include_manual or not r.manual)
Esempio n. 4
0
 def get_run_by_num(self, num):
     """Return a the run with run number which matches num."""
     return next_or_none(r for r in self.runs if r.run_num == num)
Esempio n. 5
0
 def get_run_by_state(self, state):
     """Returns the most recent run which matches the state."""
     return next_or_none(r for r in self.runs if r.state == state)
Esempio n. 6
0
 def get_first_queued(self, node=None):
     return next_or_none(
         r for r in reversed(self.runs)
         if (not node or r.node == node) and r.state == ActionRun.QUEUED
     )
Esempio n. 7
0
 def get_newest(self, include_manual=True):
     """Returns the most recently created JobRun."""
     return next_or_none(
         r for r in self.runs if include_manual or not r.manual
     )
Esempio n. 8
0
 def get_run_by_num(self, num):
     """Return a the run with run number which matches num."""
     return next_or_none(r for r in self.runs if r.run_num == num)
Esempio n. 9
0
 def get_run_by_state(self, state):
     """Returns the most recent run which matches the state."""
     return next_or_none(r for r in self.runs if r.state == state)
Esempio n. 10
0
 def get_next_to_finish(self, node=None):
     """Return the most recent run which is either running or scheduled. If
     node is not None, then only looks for runs on that node.
     """
     return next_or_none(r for r in self.runs if (
         not node or r.node == node) and (r.is_running or r.is_scheduled))