diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-09-01 18:26:03 +0100 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-09-01 18:26:03 +0100 |
commit | 8cece8b8b6fd12b6df554413894afbf1ae93d18f (patch) | |
tree | c51a596a4cd177003d56572dd277040d52094213 /cloudinit | |
parent | 60a9ebaba73b2154ce841d36978e317197b66945 (diff) | |
download | vyos-cloud-init-8cece8b8b6fd12b6df554413894afbf1ae93d18f.tar.gz vyos-cloud-init-8cece8b8b6fd12b6df554413894afbf1ae93d18f.zip |
Handle symlink mount points in mount_cb.
The Azure data source now uses a /dev/disk symlink to identify devices,
but the dereferenced version of this appears in the mount table.
mount_cb therefore doesn't identify when a disk is already mounted, and
attempts to mount it a second time (which fails with NTFS).
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 09e583f5..83c2c0d2 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1480,8 +1480,8 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True): mounted = mounts() with tempdir() as tmpd: umount = False - if device in mounted: - mountpoint = mounted[device]['mountpoint'] + if os.path.realpath(device) in mounted: + mountpoint = mounted[os.path.realpath(device)]['mountpoint'] else: failure_reason = None for mtype in mtypes: |