From 8cece8b8b6fd12b6df554413894afbf1ae93d18f Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 1 Sep 2015 18:26:03 +0100 Subject: 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). --- cloudinit/util.py | 4 ++-- 1 file 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: -- cgit v1.2.3