Skip to content

Commit 6ae57d2

Browse files
committed
Only look up cache if not using CVMFS
Partial fix for #80.
1 parent 48fdd8f commit 6ae57d2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

bin/stashcp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ def doStashCpSingle(sourceFile, destination, cache, debug=False):
109109
if destination.startswith("stash://"):
110110
# Source file exists, must be a writeback
111111
return doWriteBack(sourceFile, destination)
112-
113-
if not cache:
114-
cache = get_best_stashcache()
115-
logging.debug("Using Cache %s", cache)
116112

117113
sitename = os.environ.setdefault("OSG_SITE_NAME", "siteNotFound")
118114

@@ -166,7 +162,12 @@ def doStashCpSingle(sourceFile, destination, cache, debug=False):
166162

167163
else:
168164
logging.debug("CVMFS File does not exist")
169-
165+
166+
# If the cache is not specified by the command line, then look for the closest
167+
if not cache:
168+
cache = get_best_stashcache()
169+
logging.debug("Using Cache %s", cache)
170+
170171
# Now check the size of the file with xrootd
171172
logging.debug("Checking size of file.")
172173
(xrdfs_stdout, xrdfs_stderr) = subprocess.Popen(["xrdfs", main_redirector, "stat", sourceFile], stdout=subprocess.PIPE).communicate()

0 commit comments

Comments
 (0)