Revision 5bdce580 lib/jqueue.py

b/lib/jqueue.py
181 181
    """
182 182
    logging.debug("Worker %s processing job %s",
183 183
                  self.worker_id, job.id)
184
    proc = mcpu.Processor(self.pool.context)
184
    proc = mcpu.Processor(self.pool.queue.context)
185 185
    queue = job.queue
186 186
    try:
187 187
      try:
......
242 242

  
243 243

  
244 244
class _JobQueueWorkerPool(workerpool.WorkerPool):
245
  def __init__(self, context):
245
  def __init__(self, queue):
246 246
    super(_JobQueueWorkerPool, self).__init__(JOBQUEUE_THREADS,
247 247
                                              _JobQueueWorker)
248
    self.context = context
248
    self.queue = queue
249 249

  
250 250

  
251 251
class JobQueue(object):
252 252
  _RE_JOB_FILE = re.compile(r"^job-(%s)$" % constants.JOB_ID_TEMPLATE)
253 253

  
254 254
  def __init__(self, context):
255
    self.context = context
255 256
    self._memcache = {}
256 257
    self._my_hostname = utils.HostInfo().name
257 258

  
......
306 307
                                      " file")
307 308

  
308 309
    # Setup worker pool
309
    self._wpool = _JobQueueWorkerPool(context)
310
    self._wpool = _JobQueueWorkerPool(self)
310 311

  
311 312
    # We need to lock here because WorkerPool.AddTask() may start a job while
312 313
    # we're still doing our work.

Also available in: Unified diff