mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
find pst partition by fstab
This commit is contained in:
parent
29bd1e2f6f
commit
a4f3ee79e6
@ -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),
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user