diff options
author | Devaev Maxim <[email protected]> | 2019-10-19 19:37:32 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-10-19 19:37:32 +0300 |
commit | 34da341edc5f319a0bb0c77937470ad7cb58a140 (patch) | |
tree | 059071c94f1d6983e532873b741c1af0eb390e85 /kvmd/plugins/msd/otg.py | |
parent | c0c1febf7279fcf5e6e265a21b9561938e7bb22f (diff) |
otg msd helpers
Diffstat (limited to 'kvmd/plugins/msd/otg.py')
-rw-r--r-- | kvmd/plugins/msd/otg.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kvmd/plugins/msd/otg.py b/kvmd/plugins/msd/otg.py index db1c2254..ca57a932 100644 --- a/kvmd/plugins/msd/otg.py +++ b/kvmd/plugins/msd/otg.py @@ -27,6 +27,11 @@ from typing import Dict from typing import Type from typing import AsyncGenerator +from ...yamlconf import Option + +from ...validators.os import valid_abs_path_exists +from ...validators.os import valid_command + from . import MsdOperationError from . import BaseMsd @@ -39,6 +44,15 @@ class MsdCliOnlyError(MsdOperationError): # ===== class Plugin(BaseMsd): + @classmethod + def get_plugin_options(cls) -> Dict: + sudo = ["/usr/bin/sudo", "--non-interactive"] + return { + "storage": Option("/var/lib/kvmd/msd", type=valid_abs_path_exists, unpack_as="storage_path"), + "remount_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-remount", "{mode}"], type=valid_command), + "unlock_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-unlock", "unlock"], type=valid_command), + } + def get_state(self) -> Dict: return { "enabled": False, |