storage/reflink: no-op import_volume() if not save_on_stop

Instead of raising a NotImplementedError, just return self like 'file'
and lvm_thin. This is needed when Storage.clone() is modified in another
commit* to no longer swallow exceptions.

* "storage: factor out _wait_and_reraise(); fix clone/create"
This commit is contained in:
Rusty Bird 2018-09-09 20:01:19 +00:00
parent 60bf68a748
commit 6e8d7d4201
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -276,7 +276,8 @@ class ReflinkVolume(qubes.storage.Volume):
return self
def import_volume(self, src_volume):
self._require_save_on_stop('import_volume')
if not self.save_on_stop:
return self
try:
_copy_file(src_volume.export(), self._path_import)
except: