Commit 46f889ed authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Completed recall method (to be tested) + minor changes.

parent 61037bcb
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -46,7 +46,9 @@ class RetrieveExecutor(TaskExecutor):
                    fileList.append(srcPath)
        self.dbConn.disconnect()
        if fileList:
            self.tapeClient.connect()
            self.tapeClient.recall(fileList)
            self.tapeClient.disconnect()
        
    def retrieveData(self):
        self.dbConn.connect()
@@ -62,11 +64,11 @@ class RetrieveExecutor(TaskExecutor):
            out.write(f"osRelParentPath: {osRelParentPath}\n")            
            destPath = self.storageRetrievePath.replace("{username}", username) + osRelParentPath
            out.write(f"destPath: {destPath}\n\n")
            if storageType == "cold":
            #if storageType == "cold":
                #srcPathPrefix = self.tapeStorageBasePath.replace("{username}", self.username)
                # TO BE DONE 
                pass
            else:
            #    pass
            #else:
            os.makedirs(destPath, exist_ok = True)
            sp = subprocess.run(["rsync", "-av", srcPath, destPath], capture_output = True)
            out.write(f"rsync stdout: {sp.stdout}")
+9 −4
Original line number Diff line number Diff line
@@ -73,8 +73,13 @@ class TapeClient(object):
    
    def recall(self, fileList):
        #TODO        
         cmd = "eeadm recall"
         tmp = str(uuid.uuid1().hex) + ".tmp"
        tmp = str(uuid.uuid1().hex) + "-vos_recall.tmp"
        fp = open(tmp, "a")
        for f in fileList:
            fp.write(f"{f}\n")
        fp.close()
        self.copy("./" + tmp, "/tmp/" +  tmp)
        cmd = "eeadm recall /tmp/" + tmp
        stdin, stdout, stderr = self.client.exec_command(cmd)
    
    def recallChecksumFiles(self, dirName):