Revision 900df6cd

b/lib/mcpu.py
229 229
    @param shared: Whether the locks should be acquired in shared mode
230 230
    @type timeout: None or float
231 231
    @param timeout: Timeout for acquiring the locks
232
    @raise LockAcquireTimeout: In case locks couldn't be acquired in specified
233
        amount of time
232 234

  
233 235
    """
234 236
    if self._cbs:
......
237 239
    acquired = self.context.glm.acquire(level, names, shared=shared,
238 240
                                        timeout=timeout, priority=priority)
239 241

  
242
    if acquired is None:
243
      raise LockAcquireTimeout()
244

  
240 245
    return acquired
241 246

  
242 247
  def _ExecLU(self, lu):
......
306 311

  
307 312
          acquired = self._AcquireLocks(level, needed_locks, share,
308 313
                                        calc_timeout(), priority)
309

  
310
          if acquired is None:
311
            raise LockAcquireTimeout()
312

  
313 314
        else:
314 315
          # Adding locks
315 316
          add_locks = lu.add_locks[level]
......
374 375
      # Acquire the Big Ganeti Lock exclusively if this LU requires it,
375 376
      # and in a shared fashion otherwise (to prevent concurrent run with
376 377
      # an exclusive LU.
377
      if self._AcquireLocks(locking.LEVEL_CLUSTER, locking.BGL,
378
                            not lu_class.REQ_BGL, calc_timeout(),
379
                            priority) is None:
380
        raise LockAcquireTimeout()
381

  
378
      self._AcquireLocks(locking.LEVEL_CLUSTER, locking.BGL,
379
                          not lu_class.REQ_BGL, calc_timeout(),
380
                          priority)
382 381
      try:
383 382
        lu = lu_class(self, op, self.context, self.rpc)
384 383
        lu.ExpandNames()

Also available in: Unified diff