From: vsr Date: Fri, 7 May 2021 09:55:40 +0000 (+0300) Subject: Fix problems of killing SALOME processes on Windows X-Git-Tag: V9_7_0rc1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4bf6c936ee8103cc0aecfd35839d2d89d7f3e8fb;p=modules%2Fkernel.git Fix problems of killing SALOME processes on Windows --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index a845475ce..d30d030b9 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -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']): diff --git a/bin/salome_utils.py b/bin/salome_utils.py index e919b2484..33fc6320a 100644 --- a/bin/salome_utils.py +++ b/bin/salome_utils.py @@ -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):