storage/lvm: clean -snap LV on volume removal

This commit is contained in:
Marek Marczykowski-Górecki 2017-12-14 21:57:59 +01:00
parent 466bf89aae
commit 96bd734852
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -323,9 +323,12 @@ class ThinVolume(qubes.storage.Volume):
def remove(self):
assert self.vid
if self.is_dirty():
cmd = ['remove', self._vid_snap]
qubes_lvm(cmd, self.log)
try:
if os.path.exists('/dev/' + self._vid_snap):
cmd = ['remove', self._vid_snap]
qubes_lvm(cmd, self.log)
except AttributeError:
pass
self._remove_revisions(self.revisions.keys())
if not os.path.exists(self.path):