Storage.remove() catch IO/OSError and log it
This commit is contained in:
parent
c5810758c5
commit
116ba64e51
@ -190,8 +190,15 @@ class Storage(object):
|
|||||||
'VM directory does not exist: {}'.format(self.vm.dir_path))
|
'VM directory does not exist: {}'.format(self.vm.dir_path))
|
||||||
|
|
||||||
def remove(self):
|
def remove(self):
|
||||||
|
''' Remove all the volumes.
|
||||||
|
|
||||||
|
Errors on removal are catched and logged.
|
||||||
|
'''
|
||||||
for name, volume in self.vm.volumes.items():
|
for name, volume in self.vm.volumes.items():
|
||||||
|
try:
|
||||||
self.get_pool(volume).remove(volume)
|
self.get_pool(volume).remove(volume)
|
||||||
|
except (IOError, OSError) as e:
|
||||||
|
self.vm.log.exception("Failed to remove volume %s", name, e)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
''' Execute the start method on each pool '''
|
''' Execute the start method on each pool '''
|
||||||
|
Loading…
Reference in New Issue
Block a user