blob: 14d47f2b294214f53b810e5637b3a98398727f14 [file] [log] [blame]
"""
SPDX-FileCopyrightText: 2022-present Intel Corporation
SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
SPDX-License-Identifier: Apache-2.0
"""
import subprocess
# import logging as log
def ping(host):
# log.debug("Pinging {}".format(host))
if host is not None:
return subprocess.call(["ping", "-c", "2", "-W", "2", host],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT) == 0
else:
return False