summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-09-01 13:32:27 -0400
committerScott Moser <smoser@ubuntu.com>2015-09-01 13:32:27 -0400
commitdeb6cffaa92fb5a1244c9b28f22f85bb15d46a86 (patch)
treec51a596a4cd177003d56572dd277040d52094213
parent60a9ebaba73b2154ce841d36978e317197b66945 (diff)
parent8cece8b8b6fd12b6df554413894afbf1ae93d18f (diff)
downloadvyos-cloud-init-deb6cffaa92fb5a1244c9b28f22f85bb15d46a86.tar.gz
vyos-cloud-init-deb6cffaa92fb5a1244c9b28f22f85bb15d46a86.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). LP: #1490796
-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: