def destroy(self): if not self.exists: raise LVMError("Volume Group doesnt exist!" , self.path) try: lvm.vgreduce(self.name, [], rm=True) lvm.vgremove(self.name) except LVMError: raise VolumeGroupError("Could not complete remove VG", self.path) finally: self._exists = False
def reduce(self, pvs): if not self.exists: raise VolumeGroupError("Device has not been created!", self.path) lvm.vgreduce(self._name, pvs)