diff options
author | Devaev Maxim <[email protected]> | 2020-05-27 05:11:55 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-05-27 05:11:55 +0300 |
commit | c1602eec06908f80dd5e6655b65384cb45399659 (patch) | |
tree | 537692b4a896d02801531891801fb8e7576f74fd /kvmd | |
parent | ccff95f757dea847b72a5a61fb8f9b976804598a (diff) |
refactoring
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py index ad235c03..ad28961b 100644 --- a/kvmd/apps/__init__.py +++ b/kvmd/apps/__init__.py @@ -53,6 +53,7 @@ from ..validators.basic import valid_stripped_string from ..validators.basic import valid_stripped_string_not_empty from ..validators.basic import valid_bool from ..validators.basic import valid_number +from ..validators.basic import valid_int_f1 from ..validators.basic import valid_float_f0 from ..validators.basic import valid_float_f01 @@ -293,7 +294,7 @@ def _get_config_scheme() -> Dict: "drives": { "enabled": Option(False, type=valid_bool), - "count": Option(1, type=(lambda arg: valid_number(arg, min=1))), + "count": Option(1, type=valid_int_f1), "default": { "stall": Option(False, type=valid_bool), "cdrom": Option(False, type=valid_bool), @@ -330,7 +331,7 @@ def _get_config_scheme() -> Dict: "server": { "host": Option("::", type=valid_ip_or_host), "port": Option(5900, type=valid_port), - "max_clients": Option(10, type=(lambda arg: valid_number(arg, min=1))), + "max_clients": Option(10, type=valid_int_f1), "tls": { "ciphers": Option("ALL:@SECLEVEL=0", type=valid_ssl_ciphers), "timeout": Option(5.0, type=valid_float_f01), |