X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fnode.py;h=f5a5429cb39199337bacb0d23aa4765404754b76;hb=4289f44874d2e046bef296dc01fdbd9e89cbde96;hp=b7e86684199a807c20b101179a4449319155cd92;hpb=75a9c13d51a01652643281acd06fa78b93d68281;p=nepi.git diff --git a/src/nepi/resources/linux/node.py b/src/nepi/resources/linux/node.py index b7e86684..f5a5429c 100644 --- a/src/nepi/resources/linux/node.py +++ b/src/nepi/resources/linux/node.py @@ -428,19 +428,14 @@ class LinuxNode(ResourceManager): forces to save the exit code of the command execution to the ecodefile """ - # Prepare command to be executed as a bash script file - # Make sure command ends in ';' so the curly brackets syntax is correct - if not command.strip()[-1] == ';': - command += " ; " - # The exit code of the command will be stored in ecodefile - command = " { { %(command)s } ; echo $? > %(ecodefile)s ; } " % { + command = " %(command)s ; echo $? > %(ecodefile)s ;" % { 'command': command, 'ecodefile': ecodefile, } # Export environment - environ = "\n".join(map(lambda e: "export %s" % e, env.split(" "))) \ + environ = "\n".join(map(lambda e: "export %s" % e, env.split(" "))) + "\n" \ if env else "" # Add environ to command