starts untangling; testssh should be built out of a hostname and possibly a key,...
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Mar 2008 10:46:18 +0000 (10:46 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 25 Mar 2008 10:46:18 +0000 (10:46 +0000)
system/TestBox.py
system/TestPlc.py
system/TestSlice.py
system/TestSliver.py
system/TestSsh.py

index b2f6ab2..6c24959 100644 (file)
@@ -17,7 +17,7 @@ class TestBox:
         return self.hostname_value
 
     def is_local(self):
-        return TestSsh.is_local (self.hostname())
+        return self.test_ssh.is_local()
     
     def tar_logs(self):
         if os.path.isdir("nodeslogs"):
index 4dbfa8a..335db14 100644 (file)
@@ -59,7 +59,7 @@ class TestPlc:
         return self.plc_spec['hostname']
 
     def is_local (self):
-        return TestSsh.is_local(self.hostname())
+        return self.test_ssh.is_local()
 
     # define the API methods on this object through xmlrpc
     # would help, but not strictly necessary
index 122c1ba..41757d4 100644 (file)
@@ -20,7 +20,7 @@ class TestSlice:
         return self.slice_spec['slice_fields']['name']
     
     def is_local(self):
-        return self.test_plc.is_local()
+        return self.test_ssh.is_local()
     
     def host_to_guest(self,command):
         return self.test_plc.host_to_guest(command)
index 01b05ea..3aad927 100644 (file)
@@ -13,7 +13,7 @@ class TestSliver:
         self.test_ssh =TestSsh(self)
 
     def is_local(self):
-        return self.test_plc.is_local()
+        return self.test_ssh.is_local()
     
     def host_to_guest(self,command):
         return self.test_plc.host_to_guest(command)
index 761d5e6..17971d0 100644 (file)
@@ -23,7 +23,7 @@ class TestSsh:
 
     # check main IP address against the provided hostname
     @staticmethod
-    def is_local (hostname):
+    def is_local_hostname (hostname):
         if hostname == "localhost":
             return True
         import socket
@@ -32,7 +32,7 @@ class TestSsh:
             remote_ip = socket.gethostbyname(hostname)
             return local_ip==remote_ip
         except:
-            header("WARNING : something wrong in is_local with hostname=%s"%hostname)
+            header("WARNING : something wrong in is_local_hostname with hostname=%s"%hostname)
             return False
 
     def __init__(self,caller):
@@ -41,13 +41,13 @@ class TestSsh:
     def hostname(self):
         return self.caller.hostname()
     def is_local(self):
-        return self.caller.is_local()
+        return TestSsh.is_local_hostname(self.hostname())
     def buildname(self):
         return self.caller.buildname()
 
     # command gets run on the right box
     def to_host(self,command):
-        if self.caller.is_local():
+        if self.is_local():
             return command
         else:
             return "ssh %s %s"%(self.hostname(),TestSsh.backslash_shell_specials(command))