diff options
Diffstat (limited to 'kvmd/validators')
-rw-r--r-- | kvmd/validators/kvm.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kvmd/validators/kvm.py b/kvmd/validators/kvm.py index 5a4dd6c8..0374ebd8 100644 --- a/kvmd/validators/kvm.py +++ b/kvmd/validators/kvm.py @@ -34,6 +34,7 @@ from . import check_len from .basic import valid_stripped_string_not_empty from .basic import valid_number +from .basic import valid_string_list from .os import valid_printable_filename @@ -51,6 +52,14 @@ def valid_msd_image_name(arg: Any) -> str: return valid_printable_filename(arg, name="MSD image name") # pragma: nocover +def valid_info_fields(arg: Any, variants: Set[str]) -> Set[str]: + return set(valid_string_list( + arg=str(arg).strip(), + subval=(lambda field: check_string_in_list(field, "info field", variants)), + name="info fields list", + )) + + def valid_log_seek(arg: Any) -> int: return int(valid_number(arg, min=0, name="log seek")) |