Skip to content

Commit ddd256c

Browse files
committed
2 parents 908dd22 + 565edf5 commit ddd256c

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

bin/stashcp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def doStashCpSingle(sourceFile, destination, cache, debug=False):
2727
xrdfs = subprocess.Popen(["xrdfs", "root://stash.osgconnect.net", "stat", sourceFile], stdout=subprocess.PIPE).communicate()[0]
2828
xrdcp_version = subprocess.Popen(['echo $(xrdcp -V 2>&1)'], stdout=subprocess.PIPE, shell=True).communicate()[0][:-1]
2929
fileSize = int(re.findall(r"Size: \d+", xrdfs)[0].split(": ")[1])
30-
logging.debug("Size of the file %s is %i", sourceFile, str(fileSize))
30+
logging.debug("Size of the file %s is %s", sourceFile, str(fileSize))
3131
#cache=get_best_stashcache()
3232
logging.debug("Using Cache %s", cache)
3333

@@ -89,8 +89,8 @@ def doStashCpSingle(sourceFile, destination, cache, debug=False):
8989
xrd_exit=timed_transfer(filename=sourceFile, debug=debug, cache=cache, destination=destination)
9090

9191
end2=int(time.time()*1000)
92-
if os.path.exists(filename):
93-
dlSz=os.stat(filename).st_size
92+
if os.path.exists(destination):
93+
dlSz=os.stat(destination).st_size
9494
destSpace=1
9595

9696
payload['xrdexit1']=xrd_exit
@@ -118,8 +118,8 @@ def doStashCpSingle(sourceFile, destination, cache, debug=False):
118118
start3 = int(time.time()*1000)
119119
xrd_exit=timed_transfer(filename=sourceFile, debug=debug, cache=cache, destination=destination)
120120
end3=int(time.time()*1000)
121-
if os.path.exists(filename):
122-
dlSz=os.stat(filename).st_size
121+
if os.path.exists(destination):
122+
dlSz=os.stat(destination).st_size
123123
dltime=end3-start3
124124
if xrd_exit=='0':
125125
logging.info("Trunk Success")
@@ -242,7 +242,7 @@ def get_best_stashcache():
242242
geo_ip_sites = "http://cvmfs-s1fnal.opensciencegrid.org:8000/cvmfs/oasis.opensciencegrid.org;http://cvmfs-s1bnl.opensciencegrid.org:8000/cvmfs/oasis.opensciencegrid.org;http://cvmfs-egi.gridpp.rl.ac.uk:8000/cvmfs/oasis.opensciencegrid.org;http://klei.nikhef.nl:8000/cvmfs/oasis.opensciencegrid.org;http://cvmfsrep.grid.sinica.edu.tw:8000/cvmfs/oasis.opensciencegrid.org".split(';')
243243

244244
# Add HCC's, for good measure
245-
geo_ip_sites.insert(0,"hcc-cvmfs.unl.edu:8000/cvmfs/config-osg.opensciencegrid.org")
245+
geo_ip_sites.insert(0,"http://hcc-cvmfs.unl.edu:8000/cvmfs/config-osg.opensciencegrid.org")
246246

247247
# Append text before caches string
248248
append_text = "api/v1.0/geo/@proxy@"

bin/stashcp2/tests/test_inside_docker.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@ pylint /StashCache/bin/stashcp || /bin/true
4242

4343
result=`md5sum query1 | awk '{print $1;}'`
4444

45+
rm query1
46+
47+
# Try copying with different destintion filename
48+
/StashCache/bin/stashcp --cache=$XRD_CACHE -d /user/dweitzel/public/blast/queries/query1 query.test
49+
50+
result=`md5sum query.test | awk '{print $1;}'`
51+
4552
if [ "$result" != "12bdb9a96cd5e8ca469b727a81593201" ]; then
4653
exit 1
4754
fi
4855

49-
rm query1
56+
rm -f query.test
5057

5158
# Perform tests
5259
/StashCache/bin/stashcp --cache=$XRD_CACHE -d /user/dweitzel/public/blast/queries/query1 ./

0 commit comments

Comments
 (0)