Revision 3707f851 lib/backend.py

b/lib/backend.py
250 250
  outputarray['vg_size'] = vginfo['vg_size']
251 251
  outputarray['vg_free'] = vginfo['vg_free']
252 252

  
253
  hyper = hypervisor.GetHypervisor()
253
  hyper = hypervisor.GetHypervisor(_GetConfig())
254 254
  hyp_info = hyper.GetNodeInfo()
255 255
  if hyp_info is not None:
256 256
    outputarray.update(hyp_info)
......
285 285
  result = {}
286 286

  
287 287
  if 'hypervisor' in what:
288
    result['hypervisor'] = hypervisor.GetHypervisor().Verify()
288
    result['hypervisor'] = hypervisor.GetHypervisor(_GetConfig()).Verify()
289 289

  
290 290
  if 'filelist' in what:
291 291
    result['filelist'] = utils.FingerprintFiles(what['filelist'])
......
425 425

  
426 426
  """
427 427
  try:
428
    names = hypervisor.GetHypervisor().ListInstances()
428
    names = hypervisor.GetHypervisor(_GetConfig()).ListInstances()
429 429
  except errors.HypervisorError, err:
430 430
    logging.exception("Error enumerating instances")
431 431
    raise
......
449 449
  """
450 450
  output = {}
451 451

  
452
  iinfo = hypervisor.GetHypervisor().GetInstanceInfo(instance)
452
  iinfo = hypervisor.GetHypervisor(_GetConfig()).GetInstanceInfo(instance)
453 453
  if iinfo is not None:
454 454
    output['memory'] = iinfo[2]
455 455
    output['state'] = iinfo[4]
......
477 477
  """
478 478
  output = {}
479 479

  
480
  iinfo = hypervisor.GetHypervisor().GetAllInstancesInfo()
480
  iinfo = hypervisor.GetHypervisor(_GetConfig()).GetAllInstancesInfo()
481 481
  if iinfo:
482 482
    for name, inst_id, memory, vcpus, state, times in iinfo:
483 483
      output[name] = {
......
676 676
    return True
677 677

  
678 678
  block_devices = _GatherBlockDevs(instance)
679
  hyper = hypervisor.GetHypervisor()
679
  hyper = hypervisor.GetHypervisor(_GetConfig())
680 680

  
681 681
  try:
682 682
    hyper.StartInstance(instance, block_devices, extra_args)
......
699 699
  if instance.name not in running_instances:
700 700
    return True
701 701

  
702
  hyper = hypervisor.GetHypervisor()
702
  hyper = hypervisor.GetHypervisor(_GetConfig())
703 703
  try:
704 704
    hyper.StopInstance(instance)
705 705
  except errors.HypervisorError, err:
......
747 747
    logging.error("Cannot reboot instance that is not running")
748 748
    return False
749 749

  
750
  hyper = hypervisor.GetHypervisor()
750
  hyper = hypervisor.GetHypervisor(_GetConfig())
751 751
  if reboot_type == constants.INSTANCE_REBOOT_SOFT:
752 752
    try:
753 753
      hyper.RebootInstance(instance)
......
772 772
  """Migrates an instance to another node.
773 773

  
774 774
  """
775
  hyper = hypervisor.GetHypervisor()
775
  hyper = hypervisor.GetHypervisor(_GetConfig())
776 776

  
777 777
  try:
778 778
    hyper.MigrateInstance(instance, target, live)

Also available in: Unified diff