summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/util.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 67ea5553..4fbdf0a9 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1453,6 +1453,7 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True):
if device in mounted:
mountpoint = mounted[device]['mountpoint']
else:
+ failure_reason = None
for mtype in mtypes:
mountpoint = None
try:
@@ -1479,10 +1480,10 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True):
except (IOError, OSError) as exc:
LOG.debug("Failed mount of '%s' as '%s': %s",
device, mtype, exc)
- pass
+ failure_reason = exc
if not mountpoint:
raise MountFailedError("Failed mounting %s to %s due to: %s" %
- (device, tmpd, exc))
+ (device, tmpd, failure_reason))
# Be nice and ensure it ends with a slash
if not mountpoint.endswith("/"):