X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3dceapplication.py;h=7d26fbda91b90f36aaa34fd3f80c223f1741c66d;hb=a7e76f2c5b9646f44e5cbf6c558ed08b5b73ce28;hp=acaf0e6efebeb39eedb0e0dd1d0c590dfca84b74;hpb=998aa11be6a89197a3b30c0645771c467cad8c13;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3dceapplication.py b/src/nepi/resources/ns3/ns3dceapplication.py index acaf0e6e..7d26fbda 100644 --- a/src/nepi/resources/ns3/ns3dceapplication.py +++ b/src/nepi/resources/ns3/ns3dceapplication.py @@ -48,10 +48,22 @@ class NS3BaseDceApplication(NS3BaseApplication): "DCE environment variables.", flags = Flags.Design) + starttime = Attribute("StartTime", + "Time at which the application will start", + default = "+0.0ns", + flags = Flags.Reserved | Flags.Construct) + + stoptime = Attribute("StopTime", + "Time at which the application will stop", + default = "+0.0ns", + flags = Flags.Reserved | Flags.Construct) + cls._register_attribute(binary) cls._register_attribute(stack_size) cls._register_attribute(arguments) cls._register_attribute(environment) + cls._register_attribute(stoptime) + cls._register_attribute(starttime) @property def node(self): @@ -95,37 +107,20 @@ class NS3BaseDceApplication(NS3BaseApplication): self.simulation.dce_application_helper_uuid, "SetStackSize", self.get("stackSize")) - arguments = self.get("arguments") or "" - for arg in map(str.strip, arguments.split(";")): - self.simulation.invoke( - self.simulation.dce_application_helper_uuid, - "AddArgument", arg) - - environment = self.get("environment") or "" - for env in map(str.strip, environment.split(";")): - key, val = env.split("=") - self.simulation.invoke( - self.simulation.dce_application_helper_uuid, - "AddEnvironment", key, val) - - if self.has_attribute("files"): - files = self.get("files") or "" - for files in map(str.strip, files.split(";")): - remotepath, dcepath = env.split("=") - localpath = "${SHARE}/" + os.path.basename(remotepath) + arguments = self.get("arguments") + if arguments: + for arg in map(str.strip, arguments.split(";")): self.simulation.invoke( self.simulation.dce_application_helper_uuid, - "AddFile", localpath, dcepath) - - if self.has_attribute("stdinFile"): - stdinfile = self.get("stdinFile") - if stdinfile: - if stdinfile != "": - stdinfile = "${SHARE}/" + os.path.basename(stdinfile) - + "AddArgument", arg) + + environment = self.get("environment") + if environment: + for env in map(str.strip, environment.split(";")): + key, val = env.split("=") self.simulation.invoke( self.simulation.dce_application_helper_uuid, - "SetStdinFile", stdinfile) + "AddEnvironment", key, val) apps_uuid = self.simulation.invoke( self.simulation.dce_application_helper_uuid,