diff options
author | Maxim Devaev <[email protected]> | 2025-01-05 02:34:11 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2025-01-05 02:34:11 +0200 |
commit | 5973b9e77353c3a5d57a69253b4f8926a8405413 (patch) | |
tree | cf28cc501bffbf0a8733f5e2f8f6b330c7aeefae | |
parent | e120b50f50504e050d4c1ae904d9676142e4cf11 (diff) |
kvmd-otgconf: Ignore some errors
-rw-r--r-- | kvmd/apps/otgconf/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kvmd/apps/otgconf/__init__.py b/kvmd/apps/otgconf/__init__.py index 4ad9c2ea..ac5d54f5 100644 --- a/kvmd/apps/otgconf/__init__.py +++ b/kvmd/apps/otgconf/__init__.py @@ -103,12 +103,18 @@ class _GadgetControl: def enable_functions(self, funcs: list[str]) -> None: with self.__udc_stopped(): for func in funcs: - os.symlink(self.__get_fsrc_path(func), self.__get_fdest_path(func)) + try: + os.symlink(self.__get_fsrc_path(func), self.__get_fdest_path(func)) + except FileExistsError: + pass def disable_functions(self, funcs: list[str]) -> None: with self.__udc_stopped(): for func in funcs: - os.unlink(self.__get_fdest_path(func)) + try: + os.unlink(self.__get_fdest_path(func)) + except FileNotFoundError: + pass def list_functions(self) -> None: metas = list(self.__read_metas()) |