Commit 4b5010bc authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor changes to tape client class.

parent 158e96c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class ImportAMQPServer(AMQPServer):
        self.tapeClient = TapeClient(self.params["host"],
                                     self.params.getint("port"),
                                     self.params["user"],
                                     self.params["password"])
                                     self.params["pkey_file_path"])
        self.systemUtils = SystemUtils()
        self.path = None
        self.username = None
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ class RetrieveExecutor(TaskExecutor):
        self.tapeClient = TapeClient(self.params["host"],
                                     self.params.getint("port"),
                                     self.params["user"],
                                     self.params["password"])
                                     self.params["pkey_file_path"])
        self.params = config.loadSection("transfer_node")
        self.storageRetrievePath = self.params["retrieve_path"]
        self.params = config.loadSection("file_catalog")
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class StoreExecutor(TaskExecutor):
        self.tapeClient = TapeClient(self.params["host"],
                                     self.params.getint("port"),
                                     self.params["user"],
                                     self.params["password"])
                                     self.params["pkey_file_path"])
        self.params = config.loadSection("transfer_node")
        self.storageStorePath = self.params["store_path"]
        self.params = config.loadSection("file_catalog")
+4 −8
Original line number Diff line number Diff line
@@ -5,20 +5,16 @@ import scp
import sys
import uuid

from config import Config
from tape_task import TapeTask


class TapeClient(object):

    # Constructor
    def __init__(self):
        config = Config("vos_ts.conf")
        self.params = config.loadSection("spectrum_archive")
        self.host = self.params["host"]
        self.port = self.params.getint("port")
        self.user = self.params["user"]
        self.keyFile = self.params["pkey_file_path"]
    def __init__(self, host, port, user, keyFile):
        self.host = host
        self.port = port
        self.user = user
        self.key = paramiko.RSAKey.from_private_key_file(keyFile)
        self.client = paramiko.SSHClient()
        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())