mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 01:51:53 +08:00
static env
This commit is contained in:
11
kvmd/env.py
11
kvmd/env.py
@@ -20,12 +20,7 @@
|
||||
# ========================================================================== #
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
# =====
|
||||
# XXX: Don't use these variables for any purpose other than testing.
|
||||
# It can be removed at any time.
|
||||
|
||||
SYSFS_PREFIX = str(os.getenv("KVMD_SYSFS_PREFIX", "")).strip()
|
||||
PROCFS_PREFIX = str(os.getenv("KVMD_PROCFS_PREFIX", "")).strip()
|
||||
ETC_PREFIX = ""
|
||||
SYSFS_PREFIX = ""
|
||||
PROCFS_PREFIX = ""
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
import re
|
||||
import dataclasses
|
||||
|
||||
from . import env
|
||||
|
||||
|
||||
# =====
|
||||
class PartitionType:
|
||||
@@ -43,7 +45,7 @@ class Partition:
|
||||
|
||||
def find_partition(part_type: str) -> Partition:
|
||||
assert part_type in PartitionType.ALL
|
||||
fstab_path = "/etc/fstab"
|
||||
fstab_path = f"{env.ETC_PREFIX}/etc/fstab"
|
||||
with open(fstab_path) as file:
|
||||
for line in file.read().split("\n"):
|
||||
line = line.strip()
|
||||
|
||||
Reference in New Issue
Block a user