FilePool fix origin volume removale

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-05 18:48:34 +02:00
parent 8959e5a77e
commit c5810758c5
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -112,7 +112,6 @@ class FilePool(Pool):
_remove_if_exists(volume)
elif volume.volume_type == 'origin':
_remove_if_exists(volume)
_remove_if_exists(volume)
def rename(self, volume, old_name, new_name):
assert issubclass(volume.__class__, FileVolume)
@ -493,6 +492,8 @@ def copy_file(source, destination):
def _remove_if_exists(volume):
if os.path.exists(volume.path):
os.remove(volume.path)
if volume.volume_type == 'origin':
os.remove(volume.path_cow)
def _check_path(path):