# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
from nepi.execution.attribute import Attribute, Flags, Types
-from nepi.execution.resource import clsinit_copy
from nepi.resources.netns.netnsbase import NetNSBase
-from nepi.execution.resource import clsinit_copy, ResourceState, \
- reschedule_delay
+from nepi.execution.resource import clsinit_copy, ResourceState
import shlex
if not node:
msg = "Route not connected to Node!!"
self.error(msg)
- raise RuntimeError, msg
+ raise RuntimeError(msg)
return node[0]
return [self.node]
def do_start(self):
- if self.simulation.state < ResourceState.STARTED:
+ if self.emulation.state < ResourceState.STARTED:
self.debug("---- RESCHEDULING START ----" )
- self.ec.schedule(reschedule_delay, self.start)
+ self.ec.schedule(self.reschedule_delay, self.start)
else:
self._configure_traces()
self._start_time = self.emulation.start_time
def _configure_traces(self):
- stdout = "%s/%d.stdout " % (self.emulation.run_home, self.pid)
- stderr = "%s/%d.stderr " % (self.emulation.run_home, self.pid)
+ stdout = "%s/%d.stdout" % (self.emulation.run_home, self.guid)
+ stderr = "%s/%d.stderr" % (self.emulation.run_home, self.guid)
self._trace_filename["stdout"] = stdout
self._trace_filename["stderr"] = stderr
self._traces["stdout"] = self.emulation.create("open", stdout, "w")
if self._state == ResourceState.STARTED:
retcode = self.emulation.invoke(self.uuid, "poll")
- if retcode:
- if ret == 0:
+ if retcode is not None:
+ if retcode == 0:
self.set_stopped()
else:
out = ""