diff options
author | Chris Lumens <clumens@redhat.com> | 2012-12-04 16:33:54 -0500 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2012-12-04 16:00:57 -0800 |
commit | 5cde131d64d5c36b264ddd7eaf94ba7aa1b6607a (patch) | |
tree | 4595671dfd922e448e7c40956391ff8f760a7b36 /pyanaconda/packaging | |
parent | d7de3945cd847241b73d08650e67266b8ca19165 (diff) | |
download | anaconda-5cde131d64d5c36b264ddd7eaf94ba7aa1b6607a.tar.gz anaconda-5cde131d64d5c36b264ddd7eaf94ba7aa1b6607a.tar.xz anaconda-5cde131d64d5c36b264ddd7eaf94ba7aa1b6607a.zip |
Fix a bug when switching back to an HDISO install source (#879612).
Basically, _setupDevice gets confused when there's a symlink involved in the
path and /proc/mounts does not match what we expect. Thus, just make sure
we resolve symlinks to their real path before feeding them to get_mount_device.
Also, don't print some mount-related log messages if they'd say something like
"None is already mounted".
Diffstat (limited to 'pyanaconda/packaging')
-rw-r--r-- | pyanaconda/packaging/__init__.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py index e9a5da1ae..f7240880d 100644 --- a/pyanaconda/packaging/__init__.py +++ b/pyanaconda/packaging/__init__.py @@ -132,7 +132,9 @@ def get_mount_device(mountpoint): log.debug("found backing file %s for loop device %s" % (mount_device, loop_name)) - log.debug("%s is mounted on %s" % (mount_device, mountpoint)) + if mount_device: + log.debug("%s is mounted on %s" % (mount_device, mountpoint)) + return mount_device class Payload(object): @@ -465,14 +467,21 @@ class Payload(object): """ Prepare an install CD/DVD for use as a package source. """ log.info("setting up device %s and mounting on %s" % (device.name, mountpoint)) - if os.path.ismount(mountpoint): - mdev = get_mount_device(mountpoint) - log.warning("%s is already mounted on %s" % (mdev, mountpoint)) + # Is there a symlink involved? If so, let's get the actual path. + # This is to catch /run/install/isodir vs. /mnt/install/isodir, for + # instance. + realMountpoint = os.path.realpath(mountpoint) + + if os.path.ismount(realMountpoint): + mdev = get_mount_device(realMountpoint) + if mdev: + log.warning("%s is already mounted on %s" % (mdev, mountpoint)) + if mdev == device.path: return else: try: - isys.umount(mountpoint, removeDir=False) + isys.umount(realMountpoint, removeDir=False) except Exception as e: log.error(str(e)) log.info("umount failed -- mounting on top of it") |