added timeout for ping in linux

This commit is contained in:
Arturo Hernandez 2018-05-07 15:26:31 -04:00
parent 6f8ccc4abe
commit 50003aa9cf

View File

@ -65,7 +65,7 @@ class ZK_helper(object):
import subprocess, platform import subprocess, platform
# Ping parameters as function of OS # Ping parameters as function of OS
ping_str = "-n 1" if platform.system().lower()=="windows" else "-c 1" ping_str = "-n 1" if platform.system().lower()=="windows" else "-c 1 -W 5"
args = "ping " + " " + ping_str + " " + self.ip args = "ping " + " " + ping_str + " " + self.ip
need_sh = False if platform.system().lower()=="windows" else True need_sh = False if platform.system().lower()=="windows" else True
# Ping # Ping