From fe6007b9d04d64a354c5a2e461adae1bd85e8e53 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 18 Aug 2009 10:36:56 +0000 Subject: [PATCH] Issue 0020448: Put the omniNames log files in a subdir --- bin/nameserver.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/bin/nameserver.py b/bin/nameserver.py index 32fa88627..e4ae95334 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -63,14 +63,6 @@ class NamingServer(Server): #print "Can't create " + upath pass - #os.system("touch " + upath + "/dummy") - for fname in os.listdir(upath): - try: - if not fname.startswith("."): os.remove(upath + "/" + fname) - except: - pass - #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") - if verbose(): print "Name Service... ", #hname=os.environ["HOST"] #commands.getoutput("hostname") if sys.platform == "win32": @@ -89,6 +81,27 @@ class NamingServer(Server): #aPort=(ss.join().split(':'))[2]; #aPort=re.findall("\d+", ss[0])[0] + # \begin{E.A.} + # put the log files of omniNames in different directory with port reference, + # it is cleaner on linux and it is a fix for salome since it is impossible to + # remove the log files if the corresponding omniNames has not been killed. + # \end{E.A.} + + upath += "/omniNames_%s"%(aPort) + try: + os.mkdir(upath) + except: + #print "Can't create " + upath + pass + + #os.system("touch " + upath + "/dummy") + for fname in os.listdir(upath): + try: + os.remove(upath + "/" + fname) + except: + pass + #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") + #aSedCommand="s/.*NameService=corbaname::" + hname + ":\([[:digit:]]*\)/\1/" #print "sed command = ", aSedCommand #aPort = commands.getoutput("sed -e\"" + aSedCommand + "\"" + os.environ["OMNIORB_CONFIG"]) -- 2.39.2