Skip to content

Commit e4c9bef

Browse files
committed
Non-fatal errors should be logged as warnings; add an error if all download methods fail
1 parent fc2d30f commit e4c9bef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

stashcp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def doStashCpSingle(sourceFile, destination, methods, debug=False):
237237
payload['filesize'] = os.stat(final_destination).st_size
238238
payload['download_size'] = payload['filesize']
239239
else:
240+
logging.error("All methods failed! Unable to download file.")
240241
payload['status'] = 'Fail'
241242

242243
es_send(payload)
@@ -262,7 +263,7 @@ def download_cvmfs(sourceFile, destination, debug, payload):
262263
return True
263264

264265
except IOError as e:
265-
logging.error("Unable to copy with CVMFS, even though file exists: %s", str(e))
266+
logging.warning("Unable to copy with CVMFS, even though file exists: %s", str(e))
266267
return False
267268

268269
else:
@@ -626,7 +627,7 @@ def get_best_stashcache():
626627
minsite = random.choice(caches_list)['name']
627628
random.shuffle(caches_list)
628629
nearest_cache_list = [cache['name'] for cache in caches_list]
629-
logging.error("Unable to use Geoip to find closest cache! Returning random cache %s", minsite)
630+
logging.warning("Unable to use Geoip to find closest cache! Returning random cache %s", minsite)
630631
logging.debug("Ordered list of nearest caches: %s", str(nearest_cache_list))
631632
return minsite
632633
else:

0 commit comments

Comments
 (0)