diff options
Diffstat (limited to 'kvmd/validators/kvm.py')
-rw-r--r-- | kvmd/validators/kvm.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kvmd/validators/kvm.py b/kvmd/validators/kvm.py index fe9a8a8e..17895c47 100644 --- a/kvmd/validators/kvm.py +++ b/kvmd/validators/kvm.py @@ -28,6 +28,7 @@ from ..keyboard.mappings import KEYMAP from . import raise_error from . import check_string_in_list from . import check_re_match +from . import check_len from .basic import valid_stripped_string_not_empty from .basic import valid_number @@ -92,7 +93,8 @@ def valid_hid_mouse_wheel(arg: Any) -> int: # ===== def valid_ugpio_driver(arg: Any) -> str: - return check_re_match(arg, "GPIO driver", r"^[a-zA-Z_][a-zA-Z0-9_-]*$")[:255] + name = "GPIO driver" + return check_len(check_re_match(arg, name, r"^[a-zA-Z_][a-zA-Z0-9_-]*$"), name, 255) def valid_ugpio_mode(arg: Any) -> str: @@ -100,7 +102,8 @@ def valid_ugpio_mode(arg: Any) -> str: def valid_ugpio_channel(arg: Any) -> str: - return check_re_match(arg, "GPIO channel", r"^[a-zA-Z_][a-zA-Z0-9_-]*$")[:255] + name = "GPIO channel" + return check_len(check_re_match(arg, name, r"^[a-zA-Z_][a-zA-Z0-9_-]*$"), name, 255) def valid_ugpio_view_table(arg: Any) -> List[List[str]]: |