storage/file: use proper exception instead of assert
Return readable message to the user.
This commit is contained in:
parent
510fad9163
commit
5eceff84cb
@ -261,9 +261,10 @@ class FileVolume(qubes.storage.Volume):
|
|||||||
return self.path
|
return self.path
|
||||||
|
|
||||||
def import_volume(self, src_volume):
|
def import_volume(self, src_volume):
|
||||||
msg = "Can not import snapshot volume {!s} in to pool {!s} "
|
if src_volume.snap_on_start:
|
||||||
msg = msg.format(src_volume, self)
|
raise qubes.storage.StoragePoolException(
|
||||||
assert not src_volume.snap_on_start, msg
|
"Can not import snapshot volume {!s} in to pool {!s} ".format(
|
||||||
|
src_volume, self))
|
||||||
if self.save_on_stop:
|
if self.save_on_stop:
|
||||||
_remove_if_exists(self.path)
|
_remove_if_exists(self.path)
|
||||||
copy_file(src_volume.export(), self.path)
|
copy_file(src_volume.export(), self.path)
|
||||||
|
Loading…
Reference in New Issue
Block a user