Salome HOME
Write log even if command fails (bug in code). Right print of command to launch to...
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 10 Feb 2016 10:38:23 +0000 (11:38 +0100)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Wed, 10 Feb 2016 10:38:23 +0000 (11:38 +0100)
salomeTools.py
src/logger.py

index 30a3697146d487234b7305c021d25b05f12b5a2c..32259207fc7cd0862b30b1cebf05570dbdbc7572 100755 (executable)
@@ -152,11 +152,12 @@ class Sat(object):
                 if logger:
                     logger_command = logger
                 
-                # Execute the run method of the command
-                res = __module__.run(argv, self, logger_command)
-                
-                # put final attributes in xml log file (end time, total time, ...) and write it
-                logger_command.endWrite()
+                try:
+                    # Execute the run method of the command
+                    res = __module__.run(argv, self, logger_command)
+                finally:
+                    # put final attributes in xml log file (end time, total time, ...) and write it
+                    logger_command.endWrite()
                 
                 return res
 
index 50c349ef42f273710b1e2976ef0bd2dcc1c6fbaa..5705013be28f86e3fe988453427c8041d1a00b0f 100644 (file)
@@ -107,7 +107,10 @@ class Logger(object):
     def endWrite(self):
         
         self.write(_('\nTap the following command to get the log :\n'), screenOnly=True)
-        self.write('%s/sat log\n' % self.config.VARS.salometoolsway, screenOnly=True)
+        if 'APPLICATION' in self.config:
+            self.write('%s/sat log %s\n' % (self.config.VARS.salometoolsway, self.config.VARS.application), screenOnly=True)
+        else:
+            self.write('%s/sat log\n' % self.config.VARS.salometoolsway, screenOnly=True)
         
         dt = datetime.datetime.now()
         endtime = dt.strftime('%Y%m%d_%H%M%S')