X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fudptunnel.py;h=ae4534d2d13b483ae876e9fc2e99f5a8ed74b953;hb=47bfadde39e0d22c3df7e2bd1cd4d52f07ad8c0a;hp=5b0eac7c5eab3c3492089766cb2fbc0a04870604;hpb=0fb87d99cce02d9806a4557459e279d96a975b08;p=nepi.git diff --git a/src/nepi/resources/linux/udptunnel.py b/src/nepi/resources/linux/udptunnel.py index 5b0eac7c..ae4534d2 100644 --- a/src/nepi/resources/linux/udptunnel.py +++ b/src/nepi/resources/linux/udptunnel.py @@ -78,6 +78,16 @@ class LinuxUdpTunnel(LinuxTunnel): self.endpoint2.node.get("hostname"), msg) + def get_endpoints(self): + """ Returns the list of RM that are endpoints to the tunnel + """ + connected = [] + for guid in self.connections: + rm = self.ec.get_resource(guid) + if hasattr(rm, "udp_connect_command"): + connected.append(rm) + return connected + def initiate_connection(self, endpoint, remote_endpoint): cipher = self.get("cipher") cipher_key = self.get("cipherKey") @@ -103,7 +113,7 @@ class LinuxUdpTunnel(LinuxTunnel): (out, err), proc = endpoint.node.run(cmd, self.run_home(endpoint)) # check if execution errors occurred - msg = " Failed to connect endpoints " + msg = "Failed to connect endpoints " if proc.poll(): self.error(msg, out, err)