From 640547d441027daf6308d2861dd42c828a6ff611 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 26 May 2021 16:02:10 +0300 Subject: [PATCH] sync --- kvmd/plugins/msd/otg/__init__.py | 3 ++- kvmd/plugins/msd/relay/__init__.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py index 920d3026..8fae87bb 100644 --- a/kvmd/plugins/msd/otg/__init__.py +++ b/kvmd/plugins/msd/otg/__init__.py @@ -396,9 +396,10 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes try: if self.__new_file: get_logger().info("Closing new image file ...") + await aiofs.afile_sync(self.__new_file) await self.__new_file.close() # type: ignore except Exception: - get_logger().exception("Can't close device file") + get_logger().exception("Can't close image file") finally: self.__new_file = None self.__new_file_written = 0 diff --git a/kvmd/plugins/msd/relay/__init__.py b/kvmd/plugins/msd/relay/__init__.py index f5af6f80..659594d8 100644 --- a/kvmd/plugins/msd/relay/__init__.py +++ b/kvmd/plugins/msd/relay/__init__.py @@ -275,6 +275,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes try: if self.__device_file: get_logger().info("Closing device file ...") + await aiofs.afile_sync(self.__device_file) await self.__device_file.close() # type: ignore except Exception: get_logger().exception("Can't close device file")