smarter way to write configs, provide structure and map to avail. resources (testboxe...
[tests.git] / system / utils.py
index c4adcb6..6c26318 100644 (file)
@@ -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