Commit 5b34127c authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added 'tape_pool' param to 'migrate()' method.

parent dae4c828
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ class RetrieveExecutor(TaskExecutor):
                                     self.params.getint("port"),
                                     self.params["user"],
                                     self.params["pkey_file_path"])
        self.tapePool = self.params["tape_pool"]
        self.params = config.loadSection("transfer_node")
        self.storageRetrievePath = self.params["retrieve_path"]
        self.params = config.loadSection("file_catalog")
@@ -225,7 +226,7 @@ class RetrieveExecutor(TaskExecutor):
            # is 'cold'
            if self.storageType == "cold":
                self.tapeClient.connect()
                self.tapeClient.migrate([ f["fullPath"] for f in blockFileList ])
                self.tapeClient.migrate([ f["fullPath"] for f in blockFileList ], self.tapePool)
                self.tapeClient.disconnect()
                
            blockFileList.clear()
+2 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ class TapeClient(object):
            sys.exit("FATAL: invalid file/dir.")
        self.scp.close()
        
    def migrate(self, fileList):
    def migrate(self, fileList, tapePool):
        """
        Migrates to tape all files whose absolute path is 
        contained in 'fileList'.
@@ -86,7 +86,7 @@ class TapeClient(object):
        fp.close()
        self.copy(f"./{tmp}", f"/tmp/{tmp}")
        os.remove(f"./{tmp}")
        cmd = f"{self.EEADM} migrate /tmp/{tmp} -p pl_generic_rw_01"
        cmd = f"{self.EEADM} migrate /tmp/{tmp} -p {tapePool}"
        stdin, stdout, stderr = self.client.exec_command(cmd)
        exitCode = stdout.channel.recv_exit_status()