summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-09-01 18:26:03 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2015-09-01 18:26:03 +0100
commit8cece8b8b6fd12b6df554413894afbf1ae93d18f (patch)
treec51a596a4cd177003d56572dd277040d52094213
parent60a9ebaba73b2154ce841d36978e317197b66945 (diff)
downloadvyos-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).
-rw-r--r--cloudinit/util.py4
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: