Salome HOME
bos #19241 Prevent shaper tests hanging up
[modules/kernel.git] / bin / killSalomeWithPort.py
index 4c6651a6a044b5afd8cc3ab9cc7a882acc354944..66fd32671d5bc2da8223bdbe7f8c1ccbfb1d00b3 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python3
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -76,7 +76,7 @@ def getPiDict(port,appname='salome',full=True,hidden=True,hostname=None):
         else:
             # old-style non-dot-prefixed pidict files
             # are in the user's home directory
-            dir = os.getenv("HOME")
+            dir = os.path.expanduser("~")
             pass
         pass
 
@@ -208,9 +208,14 @@ def shutdownMyPort(port, cleanup=True):
         time.sleep(1)
         # shutdown omniNames
         if cleanup:
-            lcc.killOmniNames()
-            time.sleep(1)
-            pass
+          from salome_utils import killOmniNames
+          killOmniNames(port)
+          filedict=getPiDict(port)
+          __killMyPort(port, filedict)
+          from PortManager import releasePort
+          releasePort(port)
+          time.sleep(1)
+          pass
         pass
     except:
         pass