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

Minor changes to tape client class.

parent 158e96c7
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ class ImportAMQPServer(AMQPServer): ...@@ -26,7 +26,7 @@ class ImportAMQPServer(AMQPServer):
self.tapeClient = TapeClient(self.params["host"], self.tapeClient = TapeClient(self.params["host"],
self.params.getint("port"), self.params.getint("port"),
self.params["user"], self.params["user"],
self.params["password"]) self.params["pkey_file_path"])
self.systemUtils = SystemUtils() self.systemUtils = SystemUtils()
self.path = None self.path = None
self.username = None self.username = None
......
...@@ -16,7 +16,7 @@ class RetrieveExecutor(TaskExecutor): ...@@ -16,7 +16,7 @@ class RetrieveExecutor(TaskExecutor):
self.tapeClient = TapeClient(self.params["host"], self.tapeClient = TapeClient(self.params["host"],
self.params.getint("port"), self.params.getint("port"),
self.params["user"], self.params["user"],
self.params["password"]) self.params["pkey_file_path"])
self.params = config.loadSection("transfer_node") self.params = config.loadSection("transfer_node")
self.storageRetrievePath = self.params["retrieve_path"] self.storageRetrievePath = self.params["retrieve_path"]
self.params = config.loadSection("file_catalog") self.params = config.loadSection("file_catalog")
......
...@@ -18,7 +18,7 @@ class StoreExecutor(TaskExecutor): ...@@ -18,7 +18,7 @@ class StoreExecutor(TaskExecutor):
self.tapeClient = TapeClient(self.params["host"], self.tapeClient = TapeClient(self.params["host"],
self.params.getint("port"), self.params.getint("port"),
self.params["user"], self.params["user"],
self.params["password"]) self.params["pkey_file_path"])
self.params = config.loadSection("transfer_node") self.params = config.loadSection("transfer_node")
self.storageStorePath = self.params["store_path"] self.storageStorePath = self.params["store_path"]
self.params = config.loadSection("file_catalog") self.params = config.loadSection("file_catalog")
......
...@@ -5,20 +5,16 @@ import scp ...@@ -5,20 +5,16 @@ import scp
import sys import sys
import uuid import uuid
from config import Config
from tape_task import TapeTask from tape_task import TapeTask
class TapeClient(object): class TapeClient(object):
# Constructor # Constructor
def __init__(self): def __init__(self, host, port, user, keyFile):
config = Config("vos_ts.conf") self.host = host
self.params = config.loadSection("spectrum_archive") self.port = port
self.host = self.params["host"] self.user = user
self.port = self.params.getint("port")
self.user = self.params["user"]
self.keyFile = self.params["pkey_file_path"]
self.key = paramiko.RSAKey.from_private_key_file(keyFile) self.key = paramiko.RSAKey.from_private_key_file(keyFile)
self.client = paramiko.SSHClient() self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment