if (self.address or self.netprefix or self.netmask) is not None:
raise RuntimeError, "Cannot add more than one address to %s interfaces" % (self._KIND,)
if broadcast:
- raise ValueError, "%s interfaces cannot broadcast in PlanetLab" % (self._KIND,)
+ raise ValueError, "%s interfaces cannot broadcast in PlanetLab (%s)" % (self._KIND,broadcast)
self.address = address
self.netprefix = netprefix
raise RuntimeError, "Route %s cannot be bound to any virtual interface " \
"- PL can only handle rules over virtual interfaces. Candidates are: %s" % (route,devs)
+ print >>sys.stderr, "Setting up routes for", self.hostname
+
(out,err),proc = server.popen_ssh_command(
"( sudo -S bash -c 'cat /vsys/vroute.out >&2' & ) ; sudo -S bash -c 'cat > /vsys/vroute.in' ; sleep 0.1" % dict(
home = server.shell_escape(self.home_path)),
self._testbed.defer_add_trace(guid, trace_id)
@Marshalling.handles(ADD_ADDRESS)
- @Marshalling.args(int, str, int, str)
+ @Marshalling.args(int, str, int, Marshalling.pickled_data)
@Marshalling.retvoid
def defer_add_address(self, guid, address, netprefix, broadcast):
self._testbed.defer_add_address(guid, address, netprefix,
broadcast)
@Marshalling.handles(ADD_ROUTE)
- @Marshalling.args(int, str, int, str)
+ @Marshalling.args(int, str, int, str, int)
@Marshalling.retvoid
- def defer_add_route(self, guid, destination, netprefix, nexthop):
- self._testbed.defer_add_route(guid, destination, netprefix, nexthop)
+ def defer_add_route(self, guid, destination, netprefix, nexthop, metric):
+ self._testbed.defer_add_route(guid, destination, netprefix, nexthop, metric)
@Marshalling.handles(DO_SETUP)
@Marshalling.args()
def _read_reply(self):
data = self._process.stdout.readline()
encoded = data.rstrip()
+ if not encoded:
+ # empty == eof == dead process, poll it to un-zombify
+ self._process.poll()
+
+ raise RuntimeError, "Forwarder died while awaiting reply: %s" % (self._process.stderr.read(),)
return base64.b64decode(encoded)
def read_reply(self, which=None, transform=None):