Commit 89452ae7 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added exitCode retrieve for 'recall()' and 'migrate()' methods + added some debug blocks.

parent 6411e6d1
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -88,6 +88,15 @@ class TapeClient(object):
        os.remove(f"./{tmp}")
        cmd = f"{self.EEADM} migrate /tmp/{tmp} -p pl_generic_rw_01"
        stdin, stdout, stderr = self.client.exec_command(cmd)
        exitCode = stdout.channel.recv_exit_status()
        
        # debug block...
        out = open("tape_client_log.txt", "a")
        out.write("MIGRATE\n")
        out.write(f"exitCode: {exitCode}\n")
        out.write(f"stdout: {stdout}\n")
        out.write(f"stderr: {stderr}\n\n")
        out.close()
    
    def recall(self, fileList): 
        """
@@ -103,6 +112,15 @@ class TapeClient(object):
        os.remove(f"./{tmp}")
        cmd = f"{self.EEADM} recall /tmp/{tmp}"
        stdin, stdout, stderr = self.client.exec_command(cmd)
        exitCode = stdout.channel.recv_exit_status()
        
        # debug block...
        out = open("tape_client_log.txt", "a")
        out.write("RECALL\n")
        out.write(f"exitCode: {exitCode}\n")
        out.write(f"stdout: {stdout}\n")
        out.write(f"stderr: {stderr}\n\n")
        out.close()
    
    def recallChecksumFiles(self, dirName):
        """
@@ -112,9 +130,15 @@ class TapeClient(object):
        cmd = f"find $(dirname {dirName}) -type f \( -iname \"*-md5sum.txt\" \) | {self.EEADM}"
        stdin, stdout, stderr = self.client.exec_command(cmd)
        exitCode = stdout.channel.recv_exit_status()
        
        # debug block...
        out = open("tape_client_log.txt", "a")
        out.write("RECALL_CHECKSUM\n")
        out.write(f"exitCode: {exitCode}\n")
        out.write(f"stdout: {stdout}\n")
        out.write(f"stderr: {stderr}\n\n")
        out.close()
        
        if exitCode:
            return False
        else: