]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix problems of killing SALOME processes on Windows
authorvsr <vsr@opencascade.com>
Fri, 7 May 2021 09:55:40 +0000 (12:55 +0300)
committervsr <vsr@opencascade.com>
Fri, 7 May 2021 09:55:40 +0000 (12:55 +0300)
bin/killSalomeWithPort.py
bin/salome_utils.py

index a845475cee453b8cca6b3b19d1156367a4296741..d30d030b9739706eb830df48a042b0c96f4a53c6 100755 (executable)
@@ -404,7 +404,7 @@ def __checkUnkilledProcesses():
     def _checkUserName(_process):
         # The following is a workaround for Windows on which
         # psutil.Process().username() returns 'usergroup' + 'username'
-        return getUserName() == _process.username()
+        return getUserName() == _process.username().split('\\')[-1]
 
     def _getDictfromOutput(_processes, _wildcard=None):
         for _process in psutil.process_iter(['name', 'username']):
index e919b24847ed481c95d8b4c6c98a9795455f8c75..75770ea0db12a12b196ca9b2ee4fb5d6ad80419a 100644 (file)
@@ -451,7 +451,7 @@ def getOmniNamesPid(port):
     """
     processes = {p.info['pid']: p.info['name'] for p in psutil.process_iter(['pid', 'name'])}
     return next((c.pid for c in psutil.net_connections(kind='inet') \
-                     if c.laddr.port == port and processes.get(c.pid) == 'omniNames'), None)
+                     if c.laddr.port == port and processes.get(c.pid)).startswith('omniNames')), None)
 # --
 
 def killOmniNames(port):