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:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user