From: Cédric Aguerre Date: Fri, 7 Apr 2017 13:37:26 +0000 (+0200) Subject: add pid to port log filename X-Git-Tag: Before_multi_study_removal_06072017~7^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dab71d7128d416f87a25ae3184fd52e04d7cf53c;p=modules%2Fkernel.git add pid to port log filename --- 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 #