Revision adfa97e3

b/daemons/ganeti-masterd
322 322
    """Runs the specified opcode and returns the result.
323 323

  
324 324
    """
325
    proc = mcpu.Processor(self.server.context)
325
    # Queries don't have a job id
326
    proc = mcpu.Processor(self.server.context, None)
326 327
    return proc.ExecOpCode(op, None)
327 328

  
328 329

  
b/lib/jqueue.py
431 431
    """
432 432
    logging.info("Worker %s processing job %s",
433 433
                  self.worker_id, job.id)
434
    proc = mcpu.Processor(self.pool.queue.context)
434
    proc = mcpu.Processor(self.pool.queue.context, job.id)
435 435
    queue = job.queue
436 436
    try:
437 437
      try:
b/lib/mcpu.py
222 222
    opcodes.OpTestAllocator: cmdlib.LUTestAllocator,
223 223
    }
224 224

  
225
  def __init__(self, context):
225
  def __init__(self, context, ec_id):
226 226
    """Constructor for Processor
227 227

  
228
    @type context: GanetiContext
229
    @param context: global Ganeti context
230
    @type ec_id: string
231
    @param ec_id: execution context identifier
232

  
228 233
    """
229 234
    self.context = context
235
    self._ec_id = ec_id
230 236
    self._cbs = None
231 237
    self.rpc = rpc.RpcRunner(context.cfg)
232 238
    self.hmclass = HooksMaster
......
501 507
    logging.info(message)
502 508
    self._Feedback(" - INFO: %s" % message)
503 509

  
510
  def GetECId(self):
511
    if not self._ec_id:
512
      errors.ProgrammerError("Tried to use execution context id when not set")
513
    return self._ec_id
514

  
504 515

  
505 516
class HooksMaster(object):
506 517
  """Hooks master.

Also available in: Unified diff