]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Port manager's lock file should be created with proper permissions; we must use umask...
authorvsr <vsr@opencascade.com>
Tue, 8 Sep 2015 15:22:10 +0000 (18:22 +0300)
committervsr <vsr@opencascade.com>
Tue, 8 Sep 2015 15:22:10 +0000 (18:22 +0300)
bin/PortManager.py

index 518b4eed9bf78b3bd3b75a3c64fa260c3e625737..f1641bdb68a7b8c7ef148327fe378c5b9ff4ee64 100644 (file)
@@ -165,6 +165,7 @@ def releasePort(port):
   logger.debug("RELEASE PORT (%s)"%port)
 
   config_file, lock_file = _getConfigurationFilename()
+  oldmask = os.umask(0)
   with open(lock_file, 'w') as lock:
     # acquire lock
     __acquire_lock(lock)
@@ -199,10 +200,14 @@ def releasePort(port):
     __release_lock(lock)
 
     logger.debug("released port port: %s"%str(port))
+  
+  os.umask(oldmask)
 #
 
 def getBusyPorts():
+  busy_ports = []
   config_file, lock_file = _getConfigurationFilename()
+  oldmask = os.umask(0)
   with open(lock_file, 'w') as lock:
     # acquire lock
     __acquire_lock(lock)
@@ -222,5 +227,6 @@ def getBusyPorts():
     # release lock
     __release_lock(lock)
 
-    return busy_ports
+  os.umask(oldmask)
+  return busy_ports
 #