mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +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:
|
def enable_functions(self, funcs: list[str]) -> None:
|
||||||
with self.__udc_stopped():
|
with self.__udc_stopped():
|
||||||
for func in funcs:
|
for func in funcs:
|
||||||
|
try:
|
||||||
os.symlink(self.__get_fsrc_path(func), self.__get_fdest_path(func))
|
os.symlink(self.__get_fsrc_path(func), self.__get_fdest_path(func))
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
|
|
||||||
def disable_functions(self, funcs: list[str]) -> None:
|
def disable_functions(self, funcs: list[str]) -> None:
|
||||||
with self.__udc_stopped():
|
with self.__udc_stopped():
|
||||||
for func in funcs:
|
for func in funcs:
|
||||||
|
try:
|
||||||
os.unlink(self.__get_fdest_path(func))
|
os.unlink(self.__get_fdest_path(func))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
def list_functions(self) -> None:
|
def list_functions(self) -> None:
|
||||||
metas = list(self.__read_metas())
|
metas = list(self.__read_metas())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user