- def upload_start_command(self):
- if self.tap.node.get("hostname") != \
- self.fdnetdevice.node.get("hostname"):
- msg = "Tap and FdNetDevice are not in the same host"
- self.error(msg)
- raise RuntimeError, msg
-
- self._fd_sock_address = self.fdnetdevice.recv_fd()
- self.set("command", self._start_command)
-
- command = self.get("command")
- env = self.get("env")
-
- # We want to make sure the ccnd is running
- # before the experiment starts.
- # Run the command as a bash script in background,
- # in the host ( but wait until the command has
- # finished to continue )
- env = self.replace_paths(env)
- command = self.replace_paths(command)
-
- shfile = os.path.join(self.app_home, "start.sh")
- self.node.run_and_wait(command, self.run_home,
- shfile = shfile,
- overwrite = True)
-
- def do_deploy(self):
- if self.tap.state < ResourceState.READY or \
- self.fdnetdevice.state < ResourceState.READY:
- self.ec.schedule(self.reschedule_delay, self.deploy)
- else:
- self.do_discover()
- self.do_provision()
-
- super(PlanetlabTunTapFdLink, self).do_deploy()
-
- def do_start(self):
- if self.state == ResourceState.READY:
- command = self.get("command")
- self.info("Starting command '%s'" % command)
-
- self.set_started()
- else:
- msg = " Failed to execute command '%s'" % command
- self.error(msg, out, err)
- raise RuntimeError, msg
-