storage/reflink: use a conditional expression

This commit is contained in:
Rusty Bird 2019-12-03 18:21:50 +00:00
parent fd8e89c546
commit 4cd9e42416
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -297,10 +297,7 @@ class ReflinkVolume(qubes.storage.Volume):
return self._path_import
def _import_data_end(self, success):
if success:
self._commit(self._path_import)
else:
_remove_file(self._path_import)
(self._commit if success else _remove_file)(self._path_import)
return self
import_data_end = _coroutinized(_locked(_import_data_end))