try:
f = urllib2.urlopen(src_url)
good = True
+ except urllib2.HTTPError, error:
+ f.close()
+ return False
except urllib2.URLError, error:
# see errno.h
if error.errno in [-3, 60, 61, 110, 111]:
continue
else:
return False
- except urllib2.HTTPError, error:
- f.close()
- return False
return True
f.close()
return False
try:
f = urllib2.urlopen(src_url)
good = True
+ except urllib2.HTTPError, error:
+ # fail in a way where cron job will retry
+ msg = "unable to fetch file, http code: %d" % error.code
+ b.log_line(msg)
+ f.close()
+ raise IOError, msg
except urllib2.URLError, error:
# see errno.h
if error.errno in [-3, 60, 61, 110, 111]:
continue
else:
raise
- except urllib2.HTTPError, error:
- # fail in a way where cron job will retry
- msg = "unable to fetch file, http code: %d" % error.code
- b.log_line(msg)
- f.close()
- raise IOError, msg
o = chroot.popen("cat > %s" % b.src_rpm, mode = "w")