I am using subprocess.check_output from pythons subprocess module to execute a ping command. Here is how I am doing it:
output = subprocess.check_output([\"p
I ran into the same problem and found that the documentation has example for this type of scenario (where we write STDERR TO STDOUT and always exit successfully with return code 0) without causing/catching an exception.
output = subprocess.check_output("ping -c 2 -W 2 1.1.1.1; exit 0", stderr=subprocess.STDOUT, shell=True)
Now, you can use standard string function find to check the output string output.