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

Added VOSpace 'jobId' parameter to 'recallChecksumFiles()' method.

parent 4a7eb0d4
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ class ImportExecutor(TaskExecutor): ...@@ -83,7 +83,7 @@ class ImportExecutor(TaskExecutor):
if self.storageType == "cold": if self.storageType == "cold":
self.tapeClient.connect() self.tapeClient.connect()
self.tapeClient.recallChecksumFiles(self.path) self.tapeClient.recallChecksumFiles(self.path, self.jobId)
self.tapeClient.disconnect() self.tapeClient.disconnect()
self.logger.info(f"Checking for invalid file/dir names in '{self.path}'") self.logger.info(f"Checking for invalid file/dir names in '{self.path}'")
......
...@@ -176,13 +176,14 @@ class TapeClient(object): ...@@ -176,13 +176,14 @@ class TapeClient(object):
raise TapeClientException(cmd, exitCode, stderr) raise TapeClientException(cmd, exitCode, stderr)
return exitCode return exitCode
def recallChecksumFiles(self, dirName): def recallChecksumFiles(self, dirName, jobId):
""" """
Recursively recalls from tape all the checksum files related to Recursively recalls from tape all the checksum files related to
the 'dirName' directory. the 'dirName' directory.
A VOSpace job ID is also required as parameter.
""" """
self.logger.info("Starting RECALL_CHECKSUM operation...") self.logger.info("Starting RECALL_CHECKSUM operation...")
checksumFileList = "vos_recall_checksum_files-{jobId}.lst" checksumFileList = f"vos_recall_checksum_files-{jobId}.lst"
cmd = f"find $(dirname {dirName}) -type f \( -iname \"*-md5sum.txt\" \) > {self.VOSPACE_WD}/{checksumFileList} && {self.DSMRECALL} -filelist={self.VOSPACE_WD}/{checksumFileList} > /dev/null 2>&1" cmd = f"find $(dirname {dirName}) -type f \( -iname \"*-md5sum.txt\" \) > {self.VOSPACE_WD}/{checksumFileList} && {self.DSMRECALL} -filelist={self.VOSPACE_WD}/{checksumFileList} > /dev/null 2>&1"
try: try:
stdin, stdout, stderr = self.client.exec_command(cmd) stdin, stdout, stderr = self.client.exec_command(cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment