adapters: change "error not found" to "packet lost"

This commit is contained in:
Luna Mendes 2018-09-05 21:23:58 -03:00
parent 5428dcee3c
commit 93630f64ef
1 changed files with 8 additions and 3 deletions

View File

@ -66,10 +66,15 @@ class PingAdapter(Adapter):
else:
latency = 0
err = PING_ERROR_RGX.search(out)
err_msg = err.group(2) if not alive and err else 'error not found'
worker.log.info(f'alive={alive} latency={latency}ms')
if alive:
# we dont need to keep sending err_msg on alive scenarios
return cls._construct(alive, latency)
err = PING_ERROR_RGX.search(out)
err_msg = err.group(2) if not alive and err else 'packet lost'
worker.log.info(f'alive={alive} latency={latency}ms err={err_msg!r}')
return cls._construct(alive, latency, err_msg)