Loading transfer_service/import_amqp_server.py +17 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from db_connector import DbConnector from mailer import Mailer from node import Node from system_utils import SystemUtils from tabulate import tabulate from tape_client import TapeClient from multiprocessing import Process Loading Loading @@ -112,6 +113,10 @@ class ImportAMQPServer(AMQPServer): This method performs an import and is executed from a separate process in order to allow the 'execute_callback' to return quickly. """ nodeList = [] nodes = open("node_list.txt", "w") out = open("import_amqp_server_log.txt", "a") if storageType == "cold": tapeClient.connect() Loading Loading @@ -152,6 +157,9 @@ class ImportAMQPServer(AMQPServer): dbConn.insertNode(cnode) dbConn.setAsyncTrans(vospacePath, True) dbConn.setSticky(vospacePath, True) nodeList.append([ dir, nodeName, "DONE" ]) else: nodeList.append([ dir, nodeName, "SKIP" ]) for flist in files: for file in flist: Loading Loading @@ -186,10 +194,16 @@ class ImportAMQPServer(AMQPServer): dbConn.insertNode(dnode) dbConn.setAsyncTrans(vospacePath, True) dbConn.setSticky(vospacePath, True) nodeList.append([ file, nodeName, "DONE" ]) else: nodeList.append([ file, nodeName, "SKIP" ]) nodes.write(tabulate(nodeList)) nodes.close() m = Mailer() m.setMessage("Nodes successfully imported.") m.addReceiver("cristiano.urban@inaf.it") m.addRecipient("cristiano.urban@inaf.it") m.setMessageWithAttachment("import", "Import procedure completed", "node_list.txt") m.send() def run(self): Loading Loading
transfer_service/import_amqp_server.py +17 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from db_connector import DbConnector from mailer import Mailer from node import Node from system_utils import SystemUtils from tabulate import tabulate from tape_client import TapeClient from multiprocessing import Process Loading Loading @@ -112,6 +113,10 @@ class ImportAMQPServer(AMQPServer): This method performs an import and is executed from a separate process in order to allow the 'execute_callback' to return quickly. """ nodeList = [] nodes = open("node_list.txt", "w") out = open("import_amqp_server_log.txt", "a") if storageType == "cold": tapeClient.connect() Loading Loading @@ -152,6 +157,9 @@ class ImportAMQPServer(AMQPServer): dbConn.insertNode(cnode) dbConn.setAsyncTrans(vospacePath, True) dbConn.setSticky(vospacePath, True) nodeList.append([ dir, nodeName, "DONE" ]) else: nodeList.append([ dir, nodeName, "SKIP" ]) for flist in files: for file in flist: Loading Loading @@ -186,10 +194,16 @@ class ImportAMQPServer(AMQPServer): dbConn.insertNode(dnode) dbConn.setAsyncTrans(vospacePath, True) dbConn.setSticky(vospacePath, True) nodeList.append([ file, nodeName, "DONE" ]) else: nodeList.append([ file, nodeName, "SKIP" ]) nodes.write(tabulate(nodeList)) nodes.close() m = Mailer() m.setMessage("Nodes successfully imported.") m.addReceiver("cristiano.urban@inaf.it") m.addRecipient("cristiano.urban@inaf.it") m.setMessageWithAttachment("import", "Import procedure completed", "node_list.txt") m.send() def run(self): Loading