X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Ftap.py;h=a0ec93a6ff67b0a528763070711589c536160595;hb=dceafc553de152296b99e8c2f4b3fef1321bd7ef;hp=f2e42a682b643dc88e3a6956d94873a8cb2b9348;hpb=d5b781271af50ba526332809bc632fe17ef6d5e5;p=nepi.git diff --git a/src/nepi/resources/linux/tap.py b/src/nepi/resources/linux/tap.py index f2e42a68..a0ec93a6 100644 --- a/src/nepi/resources/linux/tap.py +++ b/src/nepi/resources/linux/tap.py @@ -107,7 +107,7 @@ class LinuxTap(LinuxApplication): def node(self): node = self.get_connected(LinuxNode.get_rtype()) if node: return node[0] - return None + raise RuntimeError, "TAP/TUN devices must be connected to Node" @property def gre_enabled(self): @@ -254,9 +254,8 @@ class LinuxTap(LinuxApplication): # upload command to connect.sh script shfile = os.path.join(connection_app_home, "gre-connect.sh") - self.node.upload(gre_connect_command, - shfile, - text = True, + self.node.upload_command(gre_connect_command, + shfile = shfile, overwrite = False) # invoke connect script @@ -294,9 +293,8 @@ class LinuxTap(LinuxApplication): # upload command to connect.sh script shfile = os.path.join(connection_app_home, "udp-connect.sh") - self.node.upload(udp_connect_command, - shfile, - text = True, + self.node.upload_command(udp_connect_command, + shfile = shfile, overwrite = False) # invoke connect script @@ -337,7 +335,7 @@ class LinuxTap(LinuxApplication): self.set("pi", True) remote_ip = socket.gethostbyname( - remote_endpoint.node.get("hostname")) + remote_endpoint.node.get("ip")) local_port_file = os.path.join(connection_run_home, "local_port") @@ -388,7 +386,7 @@ class LinuxTap(LinuxApplication): # Set the remote endpoint self.set("pointopoint", remote_endpoint.get("ip4")) self.set("greRemote", socket.gethostbyname( - remote_endpoint.node.get("hostname"))) + remote_endpoint.node.get("ip"))) # Generate GRE connect command command = ["("]