blob: 98e6be2b8ff5698b70110c8f39617b08f00f6b6e [file] [log] [blame]
"""
SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
SPDX-License-Identifier: LicenseRef-ONF-Member-1.01
"""
import os
import subprocess
import logging as log
def ping(host):
#log.debug("Pinging {}".format(host))
if host != None:
return subprocess.call(["ping", "-c", "2", "-W", "2", host],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT) == 0
else:
return False