Revision 59726e15 lib/objects.py

b/lib/objects.py
2059 2059
    cfp = cls()
2060 2060
    cfp.readfp(buf)
2061 2061
    return cfp
2062

  
2063

  
2064
class LvmPvInfo(ConfigObject):
2065
  """Information about an LVM physical volume (PV).
2066

  
2067
  @type name: string
2068
  @ivar name: name of the PV
2069
  @type vg_name: string
2070
  @ivar vg_name: name of the volume group containing the PV
2071
  @type size: float
2072
  @ivar size: size of the PV in MiB
2073
  @type free: float
2074
  @ivar free: free space in the PV, in MiB
2075
  @type attributes: string
2076
  @ivar attributes: PV attributes
2077
  """
2078
  __slots__ = [
2079
    "name",
2080
    "vg_name",
2081
    "size",
2082
    "free",
2083
    "attributes",
2084
    ]
2085

  
2086
  def IsEmpty(self):
2087
    """Is this PV empty?
2088

  
2089
    """
2090
    return self.size <= (self.free + 1)
2091

  
2092
  def IsAllocatable(self):
2093
    """Is this PV allocatable?
2094

  
2095
    """
2096
    return ("a" in self.attributes)

Also available in: Unified diff