From c8e83f27f36e3c28d42746ea783a9f6591453261 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 24 Oct 2019 15:19:05 +0300 Subject: [PATCH] #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (rollback two last commits as the fix does not work) --- bin/PortManager.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/bin/PortManager.py b/bin/PortManager.py index 9c8974d18..0b8dd94c1 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -83,14 +83,6 @@ def _getConfigurationFilename(): import tempfile temp = tempfile.NamedTemporaryFile() lock_file = os.path.join(os.path.dirname(temp.name), ".salome_PortManager.lock") - try: - oldmask = os.umask(0) - with open(lock_file, 'wb'): - pass - except IOError: - pass - finally: - os.umask(oldmask) temp.close() return (portmanager_config, lock_file) @@ -145,7 +137,7 @@ def getPort(preferredPort=None): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock) @@ -204,7 +196,7 @@ def releasePort(port): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock) @@ -247,7 +239,7 @@ def releasePort(port): def getBusyPorts(): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock) -- 2.39.2