Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-transfer-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-transfer-service
Commits
158e96c7
Commit
158e96c7
authored
Mar 12, 2021
by
Cristiano Urban
Browse files
Options
Downloads
Patches
Plain Diff
Enabled md5sum files recall test from tape.
Signed-off-by:
Cristiano Urban
<
cristiano.urban@inaf.it
>
parent
172ebd24
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
transfer_service/import_amqp_server.py
+4
-2
4 additions, 2 deletions
transfer_service/import_amqp_server.py
transfer_service/tape_client.py
+23
-10
23 additions, 10 deletions
transfer_service/tape_client.py
transfer_service/vos_ts.conf
+5
-2
5 additions, 2 deletions
transfer_service/vos_ts.conf
with
32 additions
and
14 deletions
transfer_service/import_amqp_server.py
+
4
−
2
View file @
158e96c7
...
...
@@ -89,8 +89,10 @@ class ImportAMQPServer(AMQPServer):
self
.
dbConn
.
disconnect
()
return
response
else
:
#if storageType == "cold":
# self.tapeClient.recallCheksumFiles(self.path)
if
storageType
==
"
cold
"
:
self
.
tapeClient
.
connect
()
self
.
tapeClient
.
recallChecksumFiles
(
self
.
path
)
self
.
tapeClient
.
disconnect
()
[
dirs
,
files
]
=
self
.
systemUtils
.
scanRecursive
(
os
.
path
.
dirname
(
self
.
path
))
...
...
This diff is collapsed.
Click to expand it.
transfer_service/tape_client.py
+
23
−
10
View file @
158e96c7
...
...
@@ -5,28 +5,33 @@ import scp
import
sys
import
uuid
from
config
import
Config
from
tape_task
import
TapeTask
class
TapeClient
(
object
):
# Constructor
def
__init__
(
self
,
host
,
port
,
user
,
password
):
self
.
host
=
host
self
.
port
=
port
self
.
user
=
user
self
.
password
=
password
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
"
]
self
.
key
=
paramiko
.
RSAKey
.
from_private_key_file
(
keyFile
)
self
.
client
=
paramiko
.
SSHClient
()
self
.
client
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
self
.
client
.
load_system_host_keys
()
self
.
scp
=
None
self
.
taskList
=
[]
# Connects to the tape library frontend
def
connect
(
self
):
self
.
client
.
connect
(
self
.
host
,
self
.
port
,
self
.
user
,
self
.
password
)
self
.
client
.
connect
(
hostname
=
self
.
host
,
port
=
self
.
port
,
username
=
self
.
user
,
pkey
=
self
.
key
)
# Returns the whole task list
def
getTaskList
(
self
):
...
...
@@ -79,6 +84,14 @@ class TapeClient(object):
def
recallChecksumFiles
(
self
,
dirName
):
cmd
=
"
find $(dirname
"
+
dirName
+
"
) -type f \( -iname
\"
*-md5sum.txt
\"
\) | eeadm recall
"
stdin
,
stdout
,
stderr
=
self
.
client
.
exec_command
(
cmd
)
exitCode
=
stdout
.
channel
.
recv_exit_status
()
out
=
open
(
"
tape_client_log.txt
"
,
"
a
"
)
out
.
write
(
f
"
exitCode:
{
exitCode
}
\n
"
)
out
.
close
()
if
exitCode
:
return
False
else
:
return
True
# Closes the connection
def
disconnect
(
self
):
...
...
This diff is collapsed.
Click to expand it.
transfer_service/vos_ts.conf
+
5
−
2
View file @
158e96c7
...
...
@@ -34,10 +34,13 @@ port = 5672
# Spectrum Archive
[
spectrum_archive
]
;
hostname
or
IP
address
of
the
tape
library
frontend
host
=
192
.
168
.
56
.
101
host
=
tape
-
fe
.
ia2
.
inaf
.
it
;
SSH
port
port
=
22
;
login
user
user
=
root
password
=
ibm
;
SSH
private
key
file
absolute
path
pkey_file_path
= /
home
/
transfer_service
/
tape
/
tape_rsa
############################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment