diff options
author | Maxim Devaev <[email protected]> | 2022-11-07 17:00:35 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-11-07 17:00:35 +0300 |
commit | a4f3ee79e63db6cefb063593d66f43b3a3fda67c (patch) | |
tree | 460c4c0899cc473fa26a5e059644d60e6a8d267e /kvmd | |
parent | 29bd1e2f6f026464ff6e9151631f326cf3486981 (diff) |
find pst partition by fstab
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/__init__.py | 1 | ||||
-rw-r--r-- | kvmd/apps/pst/server.py | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py index a88829d5..323b8334 100644 --- a/kvmd/apps/__init__.py +++ b/kvmd/apps/__init__.py @@ -500,7 +500,6 @@ def _get_config_scheme() -> dict: " referer='%{Referer}i'; user_agent='%{User-Agent}i'"), }, - "storage": Option("/var/lib/kvmd/pst", type=valid_abs_dir, unpack_as="storage_path"), "ro_retries_delay": Option(10.0, type=valid_float_f01), "ro_cleanup_delay": Option(3.0, type=valid_float_f01), diff --git a/kvmd/apps/pst/server.py b/kvmd/apps/pst/server.py index 1df26f61..8ea69b80 100644 --- a/kvmd/apps/pst/server.py +++ b/kvmd/apps/pst/server.py @@ -31,6 +31,7 @@ from ...logging import get_logger from ... import tools from ... import aiotools from ... import aiohelpers +from ... import fstab from ...htserver import exposed_http from ...htserver import exposed_ws @@ -42,7 +43,6 @@ from ...htserver import HttpServer class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-instance-attributes def __init__( # pylint: disable=too-many-arguments,too-many-locals self, - storage_path: str, ro_retries_delay: float, ro_cleanup_delay: float, remount_cmd: list[str], @@ -50,7 +50,7 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst super().__init__() - self.__data_path = os.path.join(storage_path, "data") + self.__data_path = os.path.join(fstab.find_partition(fstab.PartitionType.PST).root_path, "data") self.__ro_retries_delay = ro_retries_delay self.__ro_cleanup_delay = ro_cleanup_delay self.__remount_cmd = remount_cmd |