Salome HOME
Fix problems of killing SALOME processes on Windows V9_7_BR V9_7_0 V9_7_0rc1 V9_7_0rc2
authorvsr <vsr@opencascade.com>
Fri, 7 May 2021 09:55:40 +0000 (12:55 +0300)
committervsr <vsr@opencascade.com>
Fri, 7 May 2021 11:26:05 +0000 (14:26 +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..33fc6320ab91424db678545cd680cf3e4b2f2f7d 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 str(c.laddr.port) == str(port) and processes.get(c.pid).startswith('omniNames')), None)
 # --
 
 def killOmniNames(port):