Commit d2b8fe7d authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added permissions cleanup for 'store' directory on the transfer node.

parent b891b498
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import sys

from config import Config
from db_connector import DbConnector
from system_utils import SystemUtils
from tape_client import TapeClient
from task_executor import TaskExecutor

@@ -33,6 +34,7 @@ class StoreExecutor(TaskExecutor):
        self.username = None
        self.requestType = None
        self.nodeList = []
        self.systemUtils = SystemUtils()
        super(StoreExecutor, self).__init__()

    def copyData(self):
@@ -63,6 +65,11 @@ class StoreExecutor(TaskExecutor):
                os.remove(nodeOSPath)
            else:
                sys.exit("Unable to remove file/dir on the transfer node!!!")
        userInfo = self.systemUtils.userInfo(self.username)
        uid = userInfo[1]
        gid = userInfo[2]
        os.chown(srcPathPrefix, uid, gid)
        os.chmod(srcPathPrefix, 0o755)

    def update(self):
        self.dbConn.connect()
@@ -70,7 +77,6 @@ class StoreExecutor(TaskExecutor):
            self.dbConn.setAsyncTrans(node, True);
        self.dbConn.disconnect()


    def run(self):
        print("Starting store executor...")
        self.setSourceQueueName("write_ready")