nothing wrong with a stderr being not empty
[nepi.git] / nepi / resources / linux / application.py
index 0a0ed05..e4086b8 100644 (file)
 #
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 
+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()