summaryrefslogtreecommitdiffstats
path: root/pyanaconda/image.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2012-05-17 15:04:56 -0500
committerDavid Lehman <dlehman@redhat.com>2012-06-06 13:03:27 -0500
commit5a627de3cc79155e8a4ea3a2135280e5cd56d635 (patch)
tree62373febfc81b02e5fc6d50f4fcc24c16760c83b /pyanaconda/image.py
parent14ce251438aa9d116dbcd6089fcfa75efbae18ec (diff)
downloadanaconda-5a627de3cc79155e8a4ea3a2135280e5cd56d635.tar.gz
anaconda-5a627de3cc79155e8a4ea3a2135280e5cd56d635.tar.xz
anaconda-5a627de3cc79155e8a4ea3a2135280e5cd56d635.zip
Add support for cdrom and harddrive methods, including switching.
Clean up mountImage and opticalInstallMedia to match their new surroundings. Allow a path to a specific image file to be specified to mountImage. Don't automatically mount optical media we detect in opticalInstallMedia.
Diffstat (limited to 'pyanaconda/image.py')
-rw-r--r--pyanaconda/image.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 4af797330..009e38ae2 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -152,17 +152,21 @@ def mountImageDirectory(method, storage):
if errorHandler.cb(exn) == ERROR_RAISE:
raise exn
-def mountImage(isodir, tree, messageWindow):
+def mountImage(isodir, tree):
while True:
- image = findFirstIsoImage(isodir, messageWindow)
- if image is None:
- exn = MissingImageError()
- if errorHandler.cb(exn) == ERROR_RAISE:
- raise exn
- else:
- continue
+ if os.path.isfile(isodir):
+ image = isodir
+ else:
+ image = findFirstIsoImage(isodir)
+ if image is None:
+ exn = MissingImageError()
+ if errorHandler.cb(exn) == ERROR_RAISE:
+ raise exn
+ else:
+ continue
+
+ image = os.path.normpath("%s/%s" % (isodir, image))
- image = os.path.normpath("%s/%s" % (isodir, image))
try:
isys.mount(image, tree, fstype = 'iso9660', readOnly = True)
except SystemError:
@@ -190,6 +194,7 @@ def opticalInstallMedia(devicetree, mountpoint=INSTALL_TREE):
dev.format.unmount()
continue
+ dev.format.unmount()
retval = dev
break