Skip to content
Snippets Groups Projects

DownloadBinary: only print 'error' for complete failure

Merged Andre Sailer requested to merge downloadWarning into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
@@ -41,7 +41,7 @@ def install_tarfile(urltarfile, prefix, lcgprefix, with_hash=True, with_link=Tru
success = False
while counter < 5 and not success:
if counter > 0:
print("Error in downlodaing, sleeping 20 seconds before retry...")
print("Warning: Failed downloading, sleeping 20 seconds before retry...")
time.sleep(20)
counter += 1
try:
@@ -51,12 +51,13 @@ def install_tarfile(urltarfile, prefix, lcgprefix, with_hash=True, with_link=Tru
tar.extractall(path=prefix)
success = True
except urllib2.HTTPError as detail:
print('Error downloading %s : %s' % (urltarfile, detail))
print('Failed downloading %s : %s' % (urltarfile, detail))
except tarfile.ReadError as detail:
print('Error untaring %s : %s' %(urltarfile, detail))
print('Failed untaring %s : %s' % (urltarfile, detail))
except:
print('Unexpected error:', sys.exc_info()[0])
if not success:
print("Error: Completely failed to download file:", urltarfile)
sys.exit(1)
#---rename the version directory----------------------------------------------
Loading