summaryrefslogtreecommitdiffstats
path: root/urlinstall.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2000-02-17 21:57:32 +0000
committerMike Fulbright <msf@redhat.com>2000-02-17 21:57:32 +0000
commitaa2b5c57f6fc1ea42fba479146d617cec0783eeb (patch)
treea17dcd0d6973365be4f8d3c4360c5e940382f697 /urlinstall.py
parent3cc156c3ca73d00f1110deb46cdb3a5d85d0f665 (diff)
downloadanaconda-aa2b5c57f6fc1ea42fba479146d617cec0783eeb.tar.gz
anaconda-aa2b5c57f6fc1ea42fba479146d617cec0783eeb.tar.xz
anaconda-aa2b5c57f6fc1ea42fba479146d617cec0783eeb.zip
wrapped url ops so we keep trying if anon server full
Diffstat (limited to 'urlinstall.py')
-rw-r--r--urlinstall.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/urlinstall.py b/urlinstall.py
index ebe03e919..af5601e42 100644
--- a/urlinstall.py
+++ b/urlinstall.py
@@ -3,6 +3,7 @@
from comps import ComponentSet, HeaderList
import os
import rpm
+import time
import urllib
import string
import struct
@@ -33,17 +34,35 @@ class InstallMethod:
break
file = tmppath + h[FILENAME]
-
- urllib.urlretrieve(self.baseUrl + "/RedHat/RPMS/" + h[FILENAME],
- file)
+
+ connected = 0
+ while not connected:
+ try:
+ urllib.urlretrieve(self.baseUrl + "/RedHat/RPMS/" + h[FILENAME],
+ file)
+ except IOError, (errnum, msg):
+# print "IOError occurred, trying again"
+ time.sleep(5)
+ else:
+ connected = 1
+
return file
def unlinkFilename(self, fullName):
os.remove(fullName)
def readHeaders(self):
- url = urllib.urlopen(self.baseUrl + "/RedHat/base/hdlist")
+ connected = 0
+ while not connected:
+ try:
+ url = urllib.urlopen(self.baseUrl + "/RedHat/base/hdlist")
+ except IOError, (errnum, msg):
+# print "IOError occurred, trying again"
+ time.sleep(5)
+ else:
+ connected = 1
+
raw = url.read(16)
hl = []
while (raw):
@@ -68,7 +87,7 @@ class InstallMethod:
def filesDone(self):
pass
-
+
def __init__(self, url):
i = string.index(url, '://') + 2
self.baseUrl = url[0:i]