Skip to content

Commit

Permalink
storage/reflink: factor out _remove_all_images()
Browse files Browse the repository at this point in the history
(cherry picked from commit 12d882b)
  • Loading branch information
rustybird authored and marmarek committed Apr 17, 2020
1 parent 1d149d9 commit f04d6ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qubes/storage/reflink.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ def verify(self):
@_coroutinized
@_locked
def remove(self):
''' Drop volume object from pool; remove volume images from
oldest to newest; remove empty VM directory.
'''
self.pool._volumes.pop(self, None) # pylint: disable=protected-access
self._remove_all_images()
_remove_empty_dir(os.path.dirname(self._path_dirty))
return self

def _remove_all_images(self):
self._remove_incomplete_images()
self._prune_revisions(keep=0)
_remove_file(self._path_clean)
_remove_file(self._path_dirty)
_remove_empty_dir(os.path.dirname(self._path_dirty))
return self

def _remove_incomplete_images(self):
for tmp in glob.iglob(glob.escape(self._path_vid) + '*.img*~*'):
Expand Down

0 comments on commit f04d6ee

Please sign in to comment.