Skip to content
Snippets Groups Projects
Commit 46f889ed authored by Cristiano Urban's avatar Cristiano Urban
Browse files

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

parent 61037bcb
No related branches found
No related tags found
No related merge requests found
......@@ -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}")
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment