[minor] Remove deprecated function get_ip (#10883)

This commit is contained in:
Lianmin Zheng
2025-09-25 16:18:04 -07:00
committed by GitHub
parent 0035f1cefa
commit 35ec2a45a8
3 changed files with 9 additions and 15 deletions

View File

@@ -2054,13 +2054,6 @@ def set_uvicorn_logging_configs():
LOGGING_CONFIG["formatters"]["access"]["datefmt"] = "%Y-%m-%d %H:%M:%S"
def get_ip() -> Optional[str]:
host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "")
if host_ip:
return host_ip
return None
def get_open_port() -> int:
port = os.getenv("SGLANG_PORT")
if port is not None:
@@ -2400,8 +2393,10 @@ def get_local_ip_auto(fallback: str = None) -> str:
2. Network interface enumeration via get_local_ip_by_nic()
3. Remote connection method via get_local_ip_by_remote()
"""
if ip := get_ip():
return ip
# Try environment variable
host_ip = os.getenv("SGLANG_HOST_IP", "") or os.getenv("HOST_IP", "")
if host_ip:
return host_ip
logger.debug("get_ip failed")
# Fallback
if ip := get_local_ip_by_nic():