X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fapplication.py;h=e975cd26f2d6e5980a9dd8fbc0643e8fc0e0afc6;hb=6a8c7da45f7d745ea47c5020b13dfb8ada0931db;hp=5f4c998ab807dec12f861e00dddd3d9245408559;hpb=97f98e73d96e1e3106ba62f7a29f2ff7353e4c95;p=nepi.git diff --git a/src/nepi/resources/linux/application.py b/src/nepi/resources/linux/application.py index 5f4c998a..e975cd26 100644 --- a/src/nepi/resources/linux/application.py +++ b/src/nepi/resources/linux/application.py @@ -102,11 +102,9 @@ class LinuxApplication(ResourceManager): def _register_traces(cls): stdout = Trace("stdout", "Standard output stream") stderr = Trace("stderr", "Standard error stream") - buildlog = Trace("buildlog", "Output of the build process") cls._register_trace(stdout) cls._register_trace(stderr) - cls._register_trace(buildlog) def __init__(self, ec, guid): super(LinuxApplication, self).__init__(ec, guid) @@ -222,6 +220,7 @@ class LinuxApplication(ResourceManager): # replace application specific paths in the command command = self.replace_paths(command) + env = env and self.replace_paths(env) self.node.upload_command(command, self.app_home, shfile = "app.sh", @@ -248,13 +247,16 @@ class LinuxApplication(ResourceManager): # Download http sources remotely if http_sources: - command = " wget -c --directory-prefix=${SOURCES} " - check = "" + command = [" wget -c --directory-prefix=${SOURCES} "] + check = [] for source in http_sources: - command += " %s " % (source) - check += " ls ${SOURCES}/%s ;" % os.path.basename(source) + command.append(" %s " % (source)) + check.append(" ls ${SOURCES}/%s " % os.path.basename(source)) + command = " ".join(command) + check = " ; ".join(check) + # Append the command to check that the sources were downloaded command += " ; %s " % check @@ -307,7 +309,7 @@ class LinuxApplication(ResourceManager): self.node.mkdir(self.build_dir) # replace application specific paths in the command - command = self.replace_paths(command) + command = self.replace_paths(build) # Upload the command to a file, and execute asynchronously self.node.run_and_wait(command, self.app_home, @@ -323,7 +325,7 @@ class LinuxApplication(ResourceManager): self.info(" Installing sources ") # replace application specific paths in the command - command = self.replace_paths(command) + command = self.replace_paths(install) # Upload the command to a file, and execute asynchronously self.node.run_and_wait(command, self.app_home, @@ -388,7 +390,7 @@ class LinuxApplication(ResourceManager): for var in env.split(" "): environ += ' %s ' % var - command = "(" + environ + " ; " + command + ")" + command = "{" + environ + " ; " + command + " ; }" command = self.replace_paths(command) # If the command requires X11 forwarding, we @@ -515,8 +517,4 @@ class LinuxApplication(ResourceManager): def valid_connection(self, guid): # TODO: Validate! return True - # XXX: What if it is connected to more than one node? - resources = self.find_resources(exact_tags = [tags.NODE]) - self._node = resources[0] if len(resources) == 1 else None - return self._node