fix ssh 6
This commit is contained in:
parent
4fadc01ba7
commit
72489c73df
1 changed files with 9 additions and 0 deletions
|
|
@ -433,4 +433,13 @@ async def discover_via_ssh(
|
|||
except Exception as exc:
|
||||
result.errors.append(f"Error upserting {found.ip}: {exc}")
|
||||
|
||||
# Flush after each rack so that subsequent SELECTs (for other racks
|
||||
# that may share the same device IPs) see the just-added rows.
|
||||
# Without this, autoflush=False means pending db.add() calls are
|
||||
# invisible to SELECT queries, causing UniqueViolationError on flush.
|
||||
try:
|
||||
await db.flush()
|
||||
except Exception as exc:
|
||||
result.errors.append(f"Flush error after rack {rack_host}: {exc}")
|
||||
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue