summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-07-23 20:52:47 +0300
committerMaxim Devaev <[email protected]>2021-07-23 20:52:47 +0300
commit189ff593792918d3bf95c1d61c66a80fcb67744d (patch)
treee478216a6f53e0caa2c410002f61d589b3d260c2 /kvmd/plugins
parenta8b3a99b97e6b103fda0550f4b50ab029ea2ad35 (diff)
refactoring
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/msd/otg/__init__.py2
-rw-r--r--kvmd/plugins/ugpio/wol.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index bb5129a3..03e06650 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -185,7 +185,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
"unlock_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-unlock", "unlock"], type=valid_command),
"initial": {
- "image": Option("", type=(lambda arg: (valid_printable_filename(arg) if arg else ""))),
+ "image": Option("", type=valid_printable_filename, if_empty=""),
"cdrom": Option(False, type=valid_bool),
},
}
diff --git a/kvmd/plugins/ugpio/wol.py b/kvmd/plugins/ugpio/wol.py
index deeb06c6..02eb9a8c 100644
--- a/kvmd/plugins/ugpio/wol.py
+++ b/kvmd/plugins/ugpio/wol.py
@@ -21,6 +21,7 @@
import socket
+import functools
from typing import Dict
from typing import Optional
@@ -60,9 +61,9 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
@classmethod
def get_plugin_options(cls) -> Dict:
return {
- "ip": Option("255.255.255.255", type=(lambda arg: valid_ip(arg, v6=False))),
+ "ip": Option("255.255.255.255", type=functools.partial(valid_ip, v6=False)),
"port": Option(9, type=valid_port),
- "mac": Option("", type=(lambda arg: (valid_mac(arg) if arg else ""))),
+ "mac": Option("", type=valid_mac, if_empty=""),
}
def register_input(self, pin: int, debounce: float) -> None: