Revision a1860404 lib/backend.py

b/lib/backend.py
592 592
    }
593 593

  
594 594

  
595
def _GetVgSpindlesInfo(name, excl_stor):
596
  """Retrieves information about spindles in an LVM volume group.
597

  
598
  @type name: string
599
  @param name: VG name
600
  @type excl_stor: bool
601
  @param excl_stor: exclusive storage
602
  @rtype: dict
603
  @return: dictionary whose keys are "name", "vg_free", "vg_size" for VG name,
604
      free spindles, total spindles respectively
605

  
606
  """
607
  if excl_stor:
608
    (vg_free, vg_size) = bdev.LogicalVolume.GetVgSpindlesInfo(name)
609
  else:
610
    vg_free = 0
611
    vg_size = 0
612
  return {
613
    "name": name,
614
    "vg_free": vg_free,
615
    "vg_size": vg_size,
616
    }
617

  
618

  
595 619
def _GetHvInfo(name):
596 620
  """Retrieves node information from a hypervisor.
597 621

  
......
653 677
  constants.ST_DISKLESS: None,
654 678
  constants.ST_EXT: None,
655 679
  constants.ST_FILE: None,
680
  constants.ST_LVM_PV: _GetVgSpindlesInfo,
656 681
  constants.ST_LVM_VG: _GetVgInfo,
657 682
  constants.ST_RADOS: None,
658 683
}

Also available in: Unified diff