mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
kvmd-otgconf: Ignore some errors
This commit is contained in:
parent
e120b50f50
commit
5973b9e773
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user