From 831e2e9cfb55b58f7ad66a4796ec25b84c84e0e7 Mon Sep 17 00:00:00 2001 From: SPN Salome - CEA Date: Thu, 8 Jun 2017 15:30:27 +0200 Subject: [PATCH] bug fix for jobs command with multiple users --- src/logger.py | 10 ++++++---- src/xmlManager.py | 17 ++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/logger.py b/src/logger.py index 899df63..48c6633 100644 --- a/src/logger.py +++ b/src/logger.py @@ -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 , diff --git a/src/xmlManager.py b/src/xmlManager.py index 78e84e7..ca8ec61 100644 --- a/src/xmlManager.py +++ b/src/xmlManager.py @@ -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("\n") - if stylesheet: - f.write("\n" % - stylesheet) - f.write(etree.tostring(self.xmlroot, encoding='utf-8')) - f.close() + try: + f = open(log_file_path, 'w') + f.write("\n") + if stylesheet: + f.write("\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. -- 2.39.2