X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nepi%2Fresources%2Flinux%2Fapplication.py;h=e4086b8d93156d5514b1b87cc0b25dfeed21f11f;hb=ddb5d7e50ffef50b41186199de2a9b6b21850bf8;hp=0a0ed05d46e2173aaff98ef83fe96bf3d1da09ae;hpb=a2a87833301e237bfa94bdad80c01190f6b4a04b;p=nepi.git diff --git a/nepi/resources/linux/application.py b/nepi/resources/linux/application.py index 0a0ed05d..e4086b8d 100644 --- a/nepi/resources/linux/application.py +++ b/nepi/resources/linux/application.py @@ -16,6 +16,10 @@ # # Author: Alina Quereilhac +import os +import subprocess +import logging + from nepi.execution.attribute import Attribute, Flags, Types from nepi.execution.trace import Trace, TraceAttr from nepi.execution.resource import ResourceManager, clsinit_copy, \ @@ -24,8 +28,9 @@ from nepi.resources.linux.node import LinuxNode from nepi.util.sshfuncs import ProcStatus, STDOUT from nepi.util.timefuncs import tnow, tdiffsec -import os -import subprocess +# to debug, just use +# logging.getLogger('application').setLevel(logging.DEBUG) +logger = logging.getLogger("application") # TODO: Resolve wildcards in commands!! # TODO: When a failure occurs during deployment, scp and ssh processes are left running behind!! @@ -248,6 +253,7 @@ class LinuxApplication(ResourceManager): self.info("Retrieving '{}' trace {} ".format(name, attr)) path = self.trace_filepath(name) + logger.debug("trace: path= {}".format(path)) command = "(test -f {} && echo 'success') || echo 'error'".format(path) (out, err), proc = self.node.execute(command) @@ -723,10 +729,15 @@ class LinuxApplication(ResourceManager): = self.node.check_errors(self.run_home) if err: - msg = "Failed to execute command '{}'"\ - .format(self.get("command")) - self.error(msg, out, err) - self.do_fail() + # Thierry : there's nothing wrong with a non-empty + # stderr, is there ? + #msg = "Failed to execute command '{}'"\ + # .format(self.get("command")) + #self.error(msg, out, err) + #self.do_fail() + # xxx TODO OTOH it would definitely make sense + # to check the exitcode + pass else: self.set_stopped()