diff options
Diffstat (limited to 'kvmd/validators/hw.py')
-rw-r--r-- | kvmd/validators/hw.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kvmd/validators/hw.py b/kvmd/validators/hw.py index 82d1221a..59a0363d 100644 --- a/kvmd/validators/hw.py +++ b/kvmd/validators/hw.py @@ -24,6 +24,7 @@ from typing import Any from . import check_in_list from . import check_re_match +from . import check_len from .basic import valid_number @@ -44,7 +45,8 @@ def valid_gpio_pin_optional(arg: Any) -> int: def valid_otg_gadget(arg: Any) -> str: - return check_re_match(arg, "OTG gadget name", r"^[a-z_][a-z0-9_-]*$")[:255] + name = "OTG gadget name" + return check_len(check_re_match(arg, name, r"^[a-z_][a-z0-9_-]*$"), name, 255) def valid_otg_id(arg: Any) -> int: |