system-config/modules/jenkins_slave/files/slave_scripts/ping.py
Andrew Hutchings aae2f80fdd Make all Python pass pyflakes
This found one bug, but will also help us with Jenkins testing of these scripts

Change-Id: Iabe171645c06f769957db7cf0def1d10a0e47988
2012-05-25 14:26:41 +01:00

12 lines
238 B
Python
Executable File

#!/usr/bin/env python
import sys
from subprocess import Popen, PIPE
p = Popen(["ping", sys.argv[1]], stdout=PIPE)
while True:
line = p.stdout.readline().strip()
if 'bytes from' in line:
p.terminate()
sys.exit(0)