diff options
author | Maxim Devaev <[email protected]> | 2022-06-13 12:42:21 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-06-13 12:42:21 +0300 |
commit | b906d7f74c88475b729533a9a387c2891798db50 (patch) | |
tree | 5aac0ae020c1cb193055e044c5614f1df281ea05 /kvmd/helpers | |
parent | 8682a4ac90bf9a188185cf48661e19008d5ea7e5 (diff) |
deprecated X-kvmd.[otgmsd|pst]-root
Diffstat (limited to 'kvmd/helpers')
-rw-r--r-- | kvmd/helpers/remount/__init__.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kvmd/helpers/remount/__init__.py b/kvmd/helpers/remount/__init__.py index 960339f3..0fee683f 100644 --- a/kvmd/helpers/remount/__init__.py +++ b/kvmd/helpers/remount/__init__.py @@ -38,8 +38,7 @@ _FSTAB_PATH = "/etc/fstab" # ===== @dataclasses.dataclass(frozen=True) class _Storage: - mount_path: str - root_path: str + path: str user: str @@ -56,11 +55,10 @@ def _find_storage(target: str) -> _Storage: if line and not line.startswith("#"): parts = line.split() if len(parts) == 6: - options = dict(re.findall(r"X-kvmd\.%s-(root|user)=([^,]+)" % (target), parts[3])) + options = dict(re.findall(r"X-kvmd\.%s-(user)=([^,]+)" % (target), parts[3])) if options: return _Storage( - mount_path=parts[1], - root_path=options.get("root", ""), + path=parts[1], user=options.get("user", ""), ) raise SystemExit(f"Can't find {target!r} mountpoint in {_FSTAB_PATH}") @@ -112,10 +110,10 @@ def main() -> None: rw = (sys.argv[1] == "rw") storage = _find_storage(target) - _remount(storage.mount_path, rw) - if rw and storage.root_path: + _remount(storage.path, rw) + if rw: for name in dirs: - path = os.path.join(storage.root_path, name) + path = os.path.join(storage.path, name) _mkdir(path) if storage.user: _chown(path, storage.user) |