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

Added support for 'location_id' parameter.

parent e477958c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ class Node(object):
        self.name = name
        self.wrapperDir = None
        self.type = type
        self.locationId = None
        self.format = None
        self.transferType = None
        self.busyState = None
@@ -57,6 +58,9 @@ class Node(object):
        else:
            sys.exit(f"FATAL: Invalid type {type}")
            
    def setLocationId(self, locationId):
        self.locationId = locationId

    def setFormat(self, format):
        self.format = format

+8 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class StorePreprocessor(TaskExecutor):
                                  self.params["db"])
        self.params = config.loadSection("transfer_node")
        self.storageStorePath = self.params["store_path"]
        self.storageId = None
        self.jobObj = None
        self.username = None
        self.userId = None
@@ -157,6 +158,8 @@ class StorePreprocessor(TaskExecutor):
                    out.write(f"newBasePath: {basePath}\n")
                    cnode.setWrapperDir(tstampWrapperDir)                
                cnode.setParentPath(basePath)
                locationId = self.dbConn.getLocationId(self.storageId)
                cnode.setLocationId(locationId)
                cnode.setOwnerID(self.userId)
                cnode.setCreatorID(self.userId)
                if not self.dbConn.nodeExists(cnode):
@@ -182,6 +185,8 @@ class StorePreprocessor(TaskExecutor):
                        out.write(f"newBasePath: {basePath}\n")
                        dnode.setWrapperDir(tstampWrapperDir)                    
                    dnode.setParentPath(basePath)
                    locationId = self.dbConn.getLocationId(self.storageId)
                    dnode.setLocationId(locationId)
                    dnode.setOwnerID(self.userId)
                    dnode.setCreatorID(self.userId)
                    dnode.setContentMD5(self.md5calc.getMD5(file))
@@ -201,6 +206,7 @@ class StorePreprocessor(TaskExecutor):
            self.wait()
            if self.destQueue.len() < self.maxReadyJobs and self.srcQueue.len() > 0:
                self.jobObj = self.srcQueue.getJob()
                self.storageId = self.jobObj.jobInfo["storageId"]
                self.username = self.jobObj.jobInfo["userName"]
                self.prepare(self.username)
                self.execute()