- self._nodes = self.get_node(endpoint)
- pid, ppid = self.node.wait_pid(self.run_home(self.node))
-
- # If the process is not running, check for error information
- # on the remote machine
- if not pid or not ppid:
- (out, err), proc = self.node.check_errors(self.run_home(self.node))
- # Out is what was written in the stderr file
- if err:
- msg = " Failed to start command '%s' " % command
- self.error(msg, out, err)
- raise RuntimeError, msg
-
- return (pid, ppid)
-
- def switch_connect(self, endpoint, rem_endpoint):
- """ Get switch connect command
- """
- # Get and configure switch connection command
- (local_port_name, remote_ip, remote_port_num) = self.get_port_info(
- endpoint, rem_endpoint)
- switch_connect_command = endpoint.switch_connect_command(
- local_port_name, remote_ip, remote_port_num)
- self._nodes = self.get_node(endpoint)
-
- # Upload command to the file sw_connect.sh
- shfile = os.path.join(self.app_home(self.node), "sw_connect.sh")
- self.node.upload(switch_connect_command,
- shfile,
- text = True,
- overwrite = False)
+ self._pid, self._ppid = local_node.wait_pid(self.run_home(local_node))
+
+ if not self._pid or not self._ppid:
+ (out, err), proc = local_node.check_errors(self.run_home(local_node))
+ # Out is what was written in the stderr file
+ if err:
+ msg = " Failed to start connection of the OVS Tunnel "
+ self.error(msg, out, err)
+ raise RuntimeError, msg
+ return