]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
bug fix for jobs command with multiple users
authorSPN Salome - CEA <support-salome@cea.fr>
Thu, 8 Jun 2017 13:30:27 +0000 (15:30 +0200)
committerSPN Salome - CEA <support-salome@cea.fr>
Thu, 8 Jun 2017 13:30:27 +0000 (15:30 +0200)
src/logger.py
src/xmlManager.py

index 899df635557c2ad55c1e5a676f35ce2f1b4b8f79..48c6633573c17cc19ced3931c826a793f977e13c 100644 (file)
@@ -248,10 +248,12 @@ class Logger(object):
                                 + self.config.VARS.command 
                                 + ".pyconf")
         dumpedPyconfFilePath = os.path.join(logDir, 'OUT', dumpedPyconfFileName)
-        f = open(dumpedPyconfFilePath, 'w')
-        self.config.__save__(f)
-        f.close()
-        
+        try:
+            f = open(dumpedPyconfFilePath, 'w')
+            self.config.__save__(f)
+            f.close()
+        except IOError:
+            pass
 
 def date_to_datetime(date):
     '''Little method that gets year, mon, day, hour , 
index 78e84e7d8c9054731b245f7af595a186c3e16c05..ca8ec61e0d35869bd6f33a310ce5d20fe6168a62 100644 (file)
@@ -53,13 +53,16 @@ class XmlLogFile(object):
         log_file_path = self.logFile
         if file_path:
             log_file_path = file_path
-        f = open(log_file_path, 'w')
-        f.write("<?xml version='1.0' encoding='utf-8'?>\n")
-        if stylesheet:
-            f.write("<?xml-stylesheet type='text/xsl' href='%s'?>\n" % 
-                    stylesheet)    
-        f.write(etree.tostring(self.xmlroot, encoding='utf-8'))
-        f.close()  
+        try:
+            f = open(log_file_path, 'w')
+            f.write("<?xml version='1.0' encoding='utf-8'?>\n")
+            if stylesheet:
+                f.write("<?xml-stylesheet type='text/xsl' href='%s'?>\n" % 
+                        stylesheet)    
+            f.write(etree.tostring(self.xmlroot, encoding='utf-8'))
+            f.close()
+        except IOError:
+            pass  
         
     def add_simple_node(self, node_name, text=None, attrib={}):
         '''Add a node with some attibutes and text to the root node.