add a ${CODE} shorthand for linux applications,
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 11 Mar 2016 10:51:20 +0000 (11:51 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 11 Mar 2016 10:51:20 +0000 (11:51 +0100)
that refer to the full path of the (uploaded) code
that was specified with code=

nepi/resources/linux/application.py

index f9a37e1..fe4ca5a 100644 (file)
@@ -355,7 +355,7 @@ class LinuxApplication(ResourceManager):
         command = self.get("command")
 
         if command and not self.in_foreground:
-            self.info("Uploading command '{}'".format(command))
+#            self.info("Uploading command '{}'".format(command))
 
             # replace application specific paths in the command
             command = self.replace_paths(command)
@@ -764,6 +764,8 @@ class LinuxApplication(ResourceManager):
                  .replace("${RUN_HOME}", run_home)
                  .replace("${NODE_HOME}", node.node_home)
                  .replace("${HOME}", node.home_dir)
+                 # a shortcut to refer to the file uploaded as 'code = '
+                 .replace("${CODE}", "{}/code".format(app_home))
              )
 
     def valid_connection(self, guid):