Commit b82eb573 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added further details to vospace import report + minor changes on vos_import.

parent 7d3e17f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class VOSImport(AMQPClient):
        if "responseType" not in importResponse:
            sys.exit("FATAL: Malformed response, storage acknowledge expected.\n")
        elif importResponse["responseType"] == "IMPORT_STARTED":
            print("\nImport procedure started. You'll receive an email at the end of the operation.\n")
            print("\nImport procedure started.\nYou'll receive an email at the end of the operation.\n")
        elif importResponse["responseType"] == "ERROR":
            errorCode = importResponse["errorCode"]
            errorMsg = importResponse["errorMsg"]
+9 −5
Original line number Diff line number Diff line
@@ -161,10 +161,10 @@ class ImportAMQPServer(AMQPServer):
                        dbConn.setAsyncTrans(vospacePath, True)
                        dbConn.setSticky(vospacePath, True)
                        now = dt.now()
                        nodeList.append([ now, dir, vospacePath, "DONE" ])
                        nodeList.append([ now, dir, vospacePath, "container", "DONE" ])
                    else:
                        now = dt.now()
                        nodeList.append([ now, dir, vospacePath, "SKIP" ])
                        nodeList.append([ now, dir, vospacePath, "container", "SKIP" ])

        for flist in files:
            for file in flist:                
@@ -200,13 +200,13 @@ class ImportAMQPServer(AMQPServer):
                        dbConn.setAsyncTrans(vospacePath, True)
                        dbConn.setSticky(vospacePath, True)
                        now = dt.now()
                        nodeList.append([ now, file, vospacePath, "DONE" ])
                        nodeList.append([ now, file, vospacePath, "data", "DONE" ])
                    else:
                        now = dt.now()
                        nodeList.append([ now, file, vospacePath, "SKIP" ])
                        nodeList.append([ now, file, vospacePath, "data", "SKIP" ])
                        
        nlfp.write(tabulate(nodeList, 
                            headers = [ "Timestamp", "OS path", "VOSpace path", "Result"],
                            headers = [ "Timestamp", "OS path", "VOSpace path", "Node type", "Result"],
                            tablefmt = "simple"))
        nlfp.close()
        end = dt.now()
@@ -221,6 +221,10 @@ class ImportAMQPServer(AMQPServer):
        Creator ID: {userId}               
        Start time: {start}
        End time: {end}
        Processed nodes: {len(nodeList)}
        Imported nodes: {sum(res[-1] == 'DONE' for res in nodeList)}
        Skipped nodes: {sum(res[-1] == 'SKIP' for res in nodeList)}
        
        """
        m.setMessageWithAttachment("VOSpace import notification", msg, nodeListFile)
        m.send()