Revision 94bbfece

b/lib/config.py
410 410
    """
411 411
    self._SetInstanceStatus(instance_name, "down")
412 412

  
413
  def _UnlockedGetInstanceList(self):
414
    """Get the list of instances.
415

  
416
    This function is for internal use, when the config lock is already held.
417

  
418
    """
419
    self._OpenConfig()
420
    return self._config_data.instances.keys()
421

  
413 422
  @locking.ssynchronized(_config_lock, shared=1)
414 423
  def GetInstanceList(self):
415 424
    """Get the list of instances.
......
419 428
      these contains all the instances, also the ones in Admin_down state
420 429

  
421 430
    """
422
    self._OpenConfig()
423

  
424
    return self._config_data.instances.keys()
431
    return self._UnlockedGetInstanceList()
425 432

  
426 433
  @locking.ssynchronized(_config_lock, shared=1)
427 434
  def ExpandInstanceName(self, short_name):
......
433 440
    return utils.MatchNameComponent(short_name,
434 441
                                    self._config_data.instances.keys())
435 442

  
443
  def _UnlockedGetInstanceInfo(self, instance_name):
444
    """Returns informations about an instance.
445

  
446
    This function is for internal use, when the config lock is already held.
447

  
448
    """
449
    self._OpenConfig()
450

  
451
    if instance_name not in self._config_data.instances:
452
      return None
453

  
454
    return self._config_data.instances[instance_name]
455

  
436 456
  @locking.ssynchronized(_config_lock, shared=1)
437 457
  def GetInstanceInfo(self, instance_name):
438 458
    """Returns informations about an instance.
......
447 467
      the instance object
448 468

  
449 469
    """
450
    self._OpenConfig()
451

  
452
    if instance_name not in self._config_data.instances:
453
      return None
454

  
455
    return self._config_data.instances[instance_name]
470
    return self._UnlockedGetInstanceInfo(instance_name)
456 471

  
457 472
  @locking.ssynchronized(_config_lock)
458 473
  def AddNode(self, node):

Also available in: Unified diff