diff options
author | David Lehman <dlehman@redhat.com> | 2012-05-17 15:04:56 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2012-06-06 13:03:27 -0500 |
commit | 5a627de3cc79155e8a4ea3a2135280e5cd56d635 (patch) | |
tree | 62373febfc81b02e5fc6d50f4fcc24c16760c83b /pyanaconda/image.py | |
parent | 14ce251438aa9d116dbcd6089fcfa75efbae18ec (diff) | |
download | anaconda-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.py | 23 |
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 |