сонеит 7 мастер слейв
This commit is contained in:
parent
9d1aafab23
commit
55c80af9c5
1 changed files with 7 additions and 2 deletions
|
|
@ -962,16 +962,21 @@ async def discover_via_ssh(
|
||||||
)
|
)
|
||||||
if ok:
|
if ok:
|
||||||
is_slave = True
|
is_slave = True
|
||||||
slave_identifier = identifier
|
|
||||||
slave_config_text = slave_cfg
|
slave_config_text = slave_cfg
|
||||||
master_ip_for_slave = master_host
|
master_ip_for_slave = master_host
|
||||||
|
# Derive slave name from master's external_id: "lane-1-1" → "lane-1-1-slave"
|
||||||
|
master_ext_id = next(
|
||||||
|
(ext_id for ext_id, host, _ in rack_hosts if host == master_host),
|
||||||
|
master_host,
|
||||||
|
)
|
||||||
|
slave_identifier = f"{master_ext_id}-slave"
|
||||||
break
|
break
|
||||||
|
|
||||||
if not is_slave:
|
if not is_slave:
|
||||||
logger.info(f"[ssh_discovery] {candidate_ip} — not a slave rack (no secondary linking pointing to known master)")
|
logger.info(f"[ssh_discovery] {candidate_ip} — not a slave rack (no secondary linking pointing to known master)")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.info(f"[ssh_discovery] {candidate_ip} — SLAVE rack confirmed (identifier={slave_identifier}, master={master_ip_for_slave})")
|
logger.info(f"[ssh_discovery] {candidate_ip} — SLAVE rack confirmed (name={slave_identifier}, master={master_ip_for_slave})")
|
||||||
|
|
||||||
# Create Rack entry for the slave in our DB
|
# Create Rack entry for the slave in our DB
|
||||||
slave_rack_id: int | None = None
|
slave_rack_id: int | None = None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue