mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
Check config toplevel
This commit is contained in:
parent
e94a105bf5
commit
eeedb6025a
@ -140,6 +140,8 @@ def init(
|
|||||||
def _init_config(config_path: str, override_options: List[str], **load_flags: bool) -> Section:
|
def _init_config(config_path: str, override_options: List[str], **load_flags: bool) -> Section:
|
||||||
config_path = os.path.expanduser(config_path)
|
config_path = os.path.expanduser(config_path)
|
||||||
raw_config: Dict = load_yaml_file(config_path)
|
raw_config: Dict = load_yaml_file(config_path)
|
||||||
|
if not isinstance(raw_config, dict):
|
||||||
|
raise SystemExit(f"Config error: Top-level of the file {config_path!r} must be a dictionary")
|
||||||
|
|
||||||
scheme = _get_config_scheme()
|
scheme = _get_config_scheme()
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user