Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from italiangrid/develop
Browse files Browse the repository at this point in the history
Merge recall interface token support into master
  • Loading branch information
efattibene authored Sep 10, 2018
2 parents 3c185d3 + 0fa5764 commit e0cfde0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions config/hsmConfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# storm node serving the file system (if any)
STORM_BACKEND_NODE="xxx"

# storm recall interface token (mandatory)
STORM_BACKEND_TOKEN="qqq"

# migrate node list (comma separated)
MIGRATE_NODE_LIST="xxx,yyy"

Expand Down
4 changes: 2 additions & 2 deletions scripts/yamssProcessRecall
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if [ "$recfile"x != "0x" ]; then
if [ "$RECALL_USE_STORM"x = "1x" ]; then
for taskid in $($attr -q -g TSMRecT $file 2>/dev/null | tr "," " "); do
echo "Setting status=success for file $file and taskid $taskid"
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -X PUT -d "status=0" http://$STORM_BACKEND_NODE:9998/recalltable/task/$taskid 2>/dev/null
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -H "Token:$STORM_BACKEND_TOKEN" -X PUT -d "status=0" http://$STORM_BACKEND_NODE:9998/recalltable/task/$taskid 2>/dev/null
done

# remove extended attribute with taskids
Expand Down Expand Up @@ -340,7 +340,7 @@ if [ "$recfile"x != "0x" ]; then
if [ "$RECALL_USE_STORM"x = "1x" ]; then
for taskid in $($attr -q -g TSMRecT $file 2>/dev/null | tr "," " "); do
echo "Setting status=failure for file $file and taskid $taskid"
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -X PUT -d "status=3" http://$STORM_BACKEND_NODE:9998/recalltable/task/$taskid 2>/dev/null
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -H "Token:$STORM_BACKEND_TOKEN" -X PUT -d "status=3" http://$STORM_BACKEND_NODE:9998/recalltable/task/$taskid 2>/dev/null
done

# remove extended attribute with taskids
Expand Down
4 changes: 2 additions & 2 deletions scripts/yamssReorderRecall
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let numlrec=$numlrec+$numcross

# Files queued in StoRM
if [ "$RECALL_USE_STORM"x = "1x" ]; then
numtakeover=$($yamssWatchdog -t 60 $curl -s -S -X GET http://$STORM_BACKEND_NODE:9998/recalltable/cardinality/tasks/readyTakeOver)
numtakeover=$($yamssWatchdog -t 60 $curl -s -S -H "Token:$STORM_BACKEND_TOKEN" -X GET http://$STORM_BACKEND_NODE:9998/recalltable/cardinality/tasks/readyTakeOver)
# if numtakeover is empty storm is probably offline
if [ "$numtakeover"x = "x" ]; then
echo "Error: StoRM recall table service not responding"
Expand Down Expand Up @@ -129,7 +129,7 @@ done
if [ "$RECALL_USE_STORM"x = "1x" -a "$numtakeover"x != "0x" ]; then

# takes over tasks from StoRM recall table
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -X PUT -d first=$RECALL_STORM_DEQUEUE_MAX http://$STORM_BACKEND_NODE:9998/recalltable/tasks 2>/dev/null | tr '#' '\n' | tr "{" " " | tr "}" " " | while read -r myline; do
$yamssWatchdog -t 60 $curl -s -S -H "Content-Type:text/plain" -H "Token:$STORM_BACKEND_TOKEN" -X PUT -d first=$RECALL_STORM_DEQUEUE_MAX http://$STORM_BACKEND_NODE:9998/recalltable/tasks 2>/dev/null | tr '#' '\n' | tr "{" " " | tr "}" " " | while read -r myline; do
taskid=$(echo "$myline"|awk '{print $1}')
fname=$(echo "$myline"|awk '{print $5}')
cattr=$($attr -q -g TSMRecT $fname 2>/dev/null)
Expand Down

0 comments on commit e0cfde0

Please sign in to comment.