вайб haiku 9

This commit is contained in:
dv 2026-04-08 12:32:06 +03:00
parent c8d2538015
commit 0659f60fa3

View file

@ -507,7 +507,9 @@ async def discover_via_ssh(
continue continue
# Add the rack itself as a main_server device if it doesn't exist # Add the rack itself as a main_server device if it doesn't exist
logger.info(f"[ssh_discovery] Processing rack {rack_host} ({rack_name})") # Use external_id (e.g., "lane-1-1") as the hostname
rack_hostname = external_id
logger.info(f"[ssh_discovery] Processing rack {rack_host} ({rack_hostname})")
try: try:
existing_rack = (await db.execute( existing_rack = (await db.execute(
select(Device).where( select(Device).where(
@ -517,7 +519,6 @@ async def discover_via_ssh(
)).scalar_one_or_none() )).scalar_one_or_none()
if existing_rack is None: if existing_rack is None:
rack_hostname = f"rack{rack_name}"
db.add(Device( db.add(Device(
object_id=obj.id, object_id=obj.id,
ip=rack_host, ip=rack_host,
@ -552,7 +553,7 @@ async def discover_via_ssh(
result.errors.append(f"Error adding rack {rack_host}: {exc}") result.errors.append(f"Error adding rack {rack_host}: {exc}")
result.actions.append(DeviceAction( result.actions.append(DeviceAction(
ip=rack_host, ip=rack_host,
hostname=f"rack{rack_name}", hostname=rack_hostname,
action="ERROR", action="ERROR",
reason=str(exc), reason=str(exc),
category="embedded", category="embedded",