Progress with LinuxTAP and UDP connections
[nepi.git] / src / nepi / resources / linux / application.py
index 45efd21..08ea700 100644 (file)
@@ -282,10 +282,11 @@ class LinuxApplication(ResourceManager):
             procs = dict()
             ps_aux = "ps aux |awk '{print $2,$11}'"
             (out, err), proc = self.node.execute(ps_aux)
-            for line in out.strip().split("\n"):
-                parts = line.strip().split(" ")
-                procs[parts[0]] = parts[1]
-            pickle.dump(procs, open("/tmp/save.proc", "wb"))
+            if len(out) != 0:
+                for line in out.strip().split("\n"):
+                    parts = line.strip().split(" ")
+                    procs[parts[0]] = parts[1]
+                pickle.dump(procs, open("/tmp/save.proc", "wb"))
             
         # create run dir for application
         self.node.mkdir(self.run_home)
@@ -359,6 +360,13 @@ class LinuxApplication(ResourceManager):
 
     def execute_deploy_command(self, command, prefix="deploy"):
         if command:
+            # replace application specific paths in the command
+            command = self.replace_paths(command)
+            
+            # replace application specific paths in the environment
+            env = self.get("env")
+            env = env and self.replace_paths(env)
+
             # Upload the command to a bash script and run it
             # in background ( but wait until the command has
             # finished to continue )
@@ -703,6 +711,7 @@ class LinuxApplication(ResourceManager):
     def execute_command(self, command, 
             env = None,
             sudo = False,
+            tty = False,
             forward_x11 = False,
             blocking = False):
 
@@ -714,6 +723,7 @@ class LinuxApplication(ResourceManager):
 
         return self.node.execute(command,
                 sudo = sudo,
+                tty = tty,
                 forward_x11 = forward_x11,
                 blocking = blocking)