Skip to content

Commit

Permalink
fix: Consider local_config type as Any
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jun 24, 2024
1 parent 7fe9689 commit abda274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/ai/backend/agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import sys
from pathlib import Path
from pprint import pformat
from typing import Any, cast

import click
from tabulate import tabulate

from ai.backend.agent.config import agent_local_config_iv, load_local_config
from ai.backend.agent.config import load_local_config
from ai.backend.cli.types import CliContextInfo
from ai.backend.common import config
from ai.backend.common.types import LogSeverity
Expand Down Expand Up @@ -82,9 +83,7 @@ def status(
Collect and print each agent process's status.
"""
try:
local_config = config.check(
load_local_config(config_path, log_level, debug), agent_local_config_iv
)
local_config = cast(Any, load_local_config(config_path, log_level, debug))
except config.ConfigurationError as e:
print(
"ConfigurationError: Could not read or validate the agent local config.",
Expand Down
5 changes: 1 addition & 4 deletions src/ai/backend/agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
from . import __version__ as VERSION
from .config import (
agent_etcd_config_iv,
agent_local_config_iv,
container_etcd_config_iv,
load_local_config,
)
Expand Down Expand Up @@ -971,9 +970,7 @@ def main(
) -> int:
"""Start the agent service as a foreground process."""
try:
local_config = config.check(
load_local_config(config_path, log_level, debug), agent_local_config_iv
)
local_config = cast(Any, load_local_config(config_path, log_level, debug))
except config.ConfigurationError as e:
print("ConfigurationError: Validation of agent local config has failed.", file=sys.stderr)
print(pformat(e.invalid_data), file=sys.stderr)
Expand Down

0 comments on commit abda274

Please sign in to comment.