X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Futils.py;h=6c26318008e7c707831cb78084fbdcabab6ee17a;hb=2f5a9f05d3d581c1c5ebe75f1d4e55ef2c5d44d1;hp=c4adcb66d7719c5f6df31974590c07976a77d9db;hpb=5c99325c366a091ab7a886d3fcf7b9aee2e0fb9f;p=tests.git diff --git a/system/utils.py b/system/utils.py index c4adcb6..6c26318 100644 --- a/system/utils.py +++ b/system/utils.py @@ -1,7 +1,6 @@ # $Id$ import time import os -import commands from pprint import PrettyPrinter # how could this accept a list again ? @@ -96,22 +95,5 @@ def system(command): print "+",now,':',command return os.system("set -x; " + command) -# checks whether a given hostname/ip responds to ping -ping_timeout_option = None -def check_ping (hostname): - # check OS (support for macos) - global ping_timeout_option - if not ping_timeout_option: - (status,osname) = commands.getstatusoutput("uname -s") - if status != 0: - raise Exception, "Cannot figure your OS name" - if osname == "Linux": - ping_timeout_option="-w" - elif osname == "Darwin": - ping_timeout_option="-t" - - command="ping -c 1 %s 1 %s"%(ping_timeout_option,hostname) - (status,output) = commands.getstatusoutput(command) - return status == 0