Revision cb6a0296 lib/backend.py

b/lib/backend.py
440 440
  """
441 441
  outputarray = {}
442 442

  
443
  vginfo = bdev.LogicalVolume.GetVGInfo([vgname])
444
  vg_free = vg_size = None
445
  if vginfo:
446
    vg_free = int(round(vginfo[0][0], 0))
447
    vg_size = int(round(vginfo[0][1], 0))
448

  
449
  outputarray['vg_size'] = vg_size
450
  outputarray['vg_free'] = vg_free
451

  
452
  hyper = hypervisor.GetHypervisor(hypervisor_type)
453
  hyp_info = hyper.GetNodeInfo()
454
  if hyp_info is not None:
455
    outputarray.update(hyp_info)
443
  if vgname is not None:
444
    vginfo = bdev.LogicalVolume.GetVGInfo([vgname])
445
    vg_free = vg_size = None
446
    if vginfo:
447
      vg_free = int(round(vginfo[0][0], 0))
448
      vg_size = int(round(vginfo[0][1], 0))
449
    outputarray['vg_size'] = vg_size
450
    outputarray['vg_free'] = vg_free
451

  
452
  if hypervisor_type is not None:
453
    hyper = hypervisor.GetHypervisor(hypervisor_type)
454
    hyp_info = hyper.GetNodeInfo()
455
    if hyp_info is not None:
456
      outputarray.update(hyp_info)
456 457

  
457 458
  outputarray["bootid"] = utils.ReadFile(_BOOT_ID_PATH, size=128).rstrip("\n")
458 459

  

Also available in: Unified diff