def refresh(self): """Refresh this LogicalVolume to match the underlying volume""" for lv in lvs(): if lv['lv_uuid'] == self.lv_uuid: self.__dict__.update(lv) return else: raise LVMError("No system logical volume found with uuid %s" % self.lv_uuid)
def find_one(cls, name): """Find the first logical volume matching name""" for lvinfo in lvs(name): return LogicalVolume(**lvinfo)
def find_all(cls, name): """Find all logical volumes matching name""" result = [] for lvinfo in lvs(name): result.append(LogicalVolume(**lvinfo)) return result