Skip to content
Snippets Groups Projects
Commit 1ea7d159 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Catch errors when unmounting snapshots

parent 8bfbd232
No related branches found
No related tags found
No related merge requests found
...@@ -264,12 +264,15 @@ class Snapshot: ...@@ -264,12 +264,15 @@ class Snapshot:
def remove(self): def remove(self):
logging.debug("removing snapshot {}".format(self.get_name())) logging.debug("removing snapshot {}".format(self.get_name()))
try:
self.unmount() self.unmount()
remove_command = [ remove_command = [
"/sbin/lvremove", "/sbin/lvremove",
self.get_full_volume() self.get_full_volume()
] ]
run_process(remove_command, check=True) run_process(remove_command, check=True)
except sp.CalledProcessError:
logging.warn("Removing {} failed".format(self.get_name()))
def unmount(self): def unmount(self):
logging.debug("unmounting snapshot {}".format(self.get_name())) logging.debug("unmounting snapshot {}".format(self.get_name()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment