summaryrefslogtreecommitdiffstats
path: root/image.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-11-04 22:33:34 +0000
committerJeremy Katz <katzj@redhat.com>2002-11-04 22:33:34 +0000
commitd8d6e8cef165d038c6c4243c9d4339cb05ea73f0 (patch)
tree2eefdf1ecfbf92c38b8f7a996bc75e9f1ed80a40 /image.py
parenta6745e390cc2d9883a118353bb377c98afcfcd0e (diff)
downloadanaconda-d8d6e8cef165d038c6c4243c9d4339cb05ea73f0.tar.gz
anaconda-d8d6e8cef165d038c6c4243c9d4339cb05ea73f0.tar.xz
anaconda-d8d6e8cef165d038c6c4243c9d4339cb05ea73f0.zip
add FileCopyException to be used when we have IO errors grabbing packages
or when pulling packages from a remote site. also, fix ts.setProbFilter
Diffstat (limited to 'image.py')
-rw-r--r--image.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/image.py b/image.py
index 41a79c1db..bfa94d297 100644
--- a/image.py
+++ b/image.py
@@ -12,7 +12,7 @@
#
from comps import ComponentSet, HeaderListFromFile
-from installmethod import InstallMethod
+from installmethod import InstallMethod, FileCopyException
import iutil
import os
import isys
@@ -251,9 +251,9 @@ class CdromInstallMethod(ImageInstallMethod):
pass
tmppath = self.getTempPath()
- copied = 0
+ tries = 0
# FIXME: should retry a few times then prompt for new cd
- while not copied:
+ while tries < 5:
try:
shutil.copy(self.tree + "/RedHat/RPMS/" + h[1000000],
tmppath + h[1000000])
@@ -262,7 +262,11 @@ class CdromInstallMethod(ImageInstallMethod):
errnum, h[1000000], str(msg))
time.sleep(5)
else:
- copied = 1
+ break
+ tries = tries + 1
+
+ if tries >= 5:
+ raise FileCopyException
return tmppath + h[1000000]