From 08ede0f3e66fb972c8f3373e204c47ac21f84e56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Fri, 7 Apr 2017 15:37:26 +0200 Subject: [PATCH] add pid to port log filename --- bin/appliskel/salome_tester/salome_instance.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/appliskel/salome_tester/salome_instance.py b/bin/appliskel/salome_tester/salome_instance.py index 8fb347e92..483c91705 100644 --- a/bin/appliskel/salome_tester/salome_instance.py +++ b/bin/appliskel/salome_tester/salome_instance.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2015-2017 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -36,21 +36,22 @@ class SalomeInstance(object): @staticmethod def start(shutdown_servers=False, with_gui=False, args=[]): import tempfile - log = tempfile.NamedTemporaryFile(suffix='_nsport.log', delete=False) + log = tempfile.NamedTemporaryFile(suffix='_nsport', delete=False) + port_log = log.name log.close() - + port_log = port_log + "-%s.log"%(os.getpid()) instance_args = [ - "--ns-port-log=%s"%log.name, + "--ns-port-log=%s"%port_log, "--shutdown-servers=%d"%shutdown_servers ] + args salome_instance = SalomeInstance() salome_instance.__run(args=instance_args, with_gui=with_gui) - with open(log.name) as f: + with open(port_log) as f: salome_instance.port = int(f.readline()) - os.remove(log.name) + os.remove(port_log) return salome_instance # -- 2.39.2