def find_all(cls, name): """Find all volume groups matching the given name""" result = [] for vginfo in vgs(name): logging.debug("Creating VolumeGroup from info %r", vginfo) result.append(VolumeGroup(**vginfo)) return result
def find_one(cls, name): """Find first LVM volume group matching the given name""" for vginfo in vgs(name): logging.debug("Creating VolumeGroup from info %r", vginfo) return VolumeGroup(**vginfo)