mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 02:21:53 +08:00
refactoring
This commit is contained in:
@@ -112,8 +112,8 @@ def valid_ssl_ciphers(arg: Any) -> str:
|
||||
arg = valid_stripped_string_not_empty(arg, name)
|
||||
try:
|
||||
ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER).set_ciphers(arg)
|
||||
except Exception as err:
|
||||
raise ValidatorError(f"The argument {arg!r} is not a valid {name}: {err}")
|
||||
except Exception as ex:
|
||||
raise ValidatorError(f"The argument {arg!r} is not a valid {name}: {ex}")
|
||||
return arg
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ def valid_abs_path(arg: Any, type: str="", name: str="") -> str: # pylint: disa
|
||||
if type:
|
||||
try:
|
||||
st = os.stat(arg)
|
||||
except Exception as err:
|
||||
raise_error(arg, f"{name}: {err}")
|
||||
except Exception as ex:
|
||||
raise_error(arg, f"{name}: {ex}")
|
||||
else:
|
||||
if not getattr(stat, f"S_IS{type.upper()}")(st.st_mode):
|
||||
raise_error(arg, name)
|
||||
|
||||
Reference in New Issue
Block a user