Only list listening sockets, since those are the ones we're looking
for. (-l, not -a)
Don't truncate IP/port numbers. (-W)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>
return
deadline = time.time() + timeout
while time.time() < deadline:
- if re.search(r'\ntcp.*:'+str(port)+' .* LISTEN *\n', str(subprocess.check_output(['netstat', '-an']))):
+ if re.search(r'\ntcp.*:'+str(port)+' .* LISTEN *\n', str(subprocess.check_output(['netstat', '-Wln']))):
return True
time.sleep(0.1)
if warn: