2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-08-03 16:07:00 +00:00

Initialize the scan total in nodediscover register

register_endpoint primes current but not total, so a first response
without a count field goes straight to

  UnboundLocalError: local variable 'total' referenced before assignment

on the elif.  Start at zero, which skips the progress line until the
server does report a count.
This commit is contained in:
Markus Hilger
2026-07-27 06:15:08 +02:00
parent 53f1d4a7c2
commit 18c24effc6
+1
View File
@@ -53,6 +53,7 @@ columnmapping = {
async def register_endpoint(options, session, addr):
neednewline = False
current = 0
total = 0
async for rsp in session.update('/discovery/register', {'addresses': addr}):
if 'count' in rsp:
total = rsp['count']