@@ -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@"
0 commit comments