Revision be6cdf67 lib/jqueue.py

b/lib/jqueue.py
224 224
               "received_timestamp", "start_timestamp", "end_timestamp",
225 225
               "__weakref__", "processor_lock", "writable", "archived"]
226 226

  
227
  def AddReasons(self):
227
  def AddReasons(self, pickup=False):
228 228
    """Extend the reason trail
229 229

  
230 230
    Add the reason for all the opcodes of this job to be executed.
......
233 233
    count = 0
234 234
    for queued_op in self.ops:
235 235
      op = queued_op.input
236
      reason_src = opcodes_base.NameToReasonSrc(op.__class__.__name__)
236
      if pickup:
237
        reason_src_prefix = constants.OPCODE_REASON_SRC_PICKUP
238
      else:
239
        reason_src_prefix = constants.OPCODE_REASON_SRC_OPCODE
240
      reason_src = opcodes_base.NameToReasonSrc(op.__class__.__name__,
241
                                                reason_src_prefix)
237 242
      reason_text = "job=%d;index=%d" % (self.id, count)
238 243
      reason = getattr(op, "reason", [])
239 244
      reason.append((reason_src, reason_text, utils.EpochNano()))
......
1725 1730
      logging.warning("Job %s could not be read", job_id)
1726 1731
      return
1727 1732

  
1733
    job.AddReasons(pickup=True)
1734

  
1728 1735
    status = job.CalcStatus()
1729 1736
    if status == constants.JOB_STATUS_QUEUED:
1730 1737
      self._EnqueueJobsUnlocked([job])

Also available in: Unified diff