From 075e22a99337bf8abb0b89916299d0d42cefe685 Mon Sep 17 00:00:00 2001 From: Ksenija Stanojevic Date: Tue, 7 Dec 2021 13:45:11 -0800 Subject: [PATCH 1/2] fix cloud-init.log --- cloudinit/util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cloudinit/util.py b/cloudinit/util.py index 2045a6abfdd..7556e155a16 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1752,8 +1752,12 @@ def mount_cb(device, callback, data=None, mtype=None, mountpoint = tmpd break except (IOError, OSError) as exc: - LOG.debug("Failed mount of '%s' as '%s': %s", - device, mtype, exc) + stderr = "Stderr: mount: unknown filesystem type 'ntfs'" + if stderr in str(exc): + LOG.debug("No support for mounting ntfs.") + else: + LOG.debug("Failed mount of '%s' as '%s': %s", + device, mtype, exc) failure_reason = exc if not mountpoint: raise MountFailedError("Failed mounting %s to %s due to: %s" % From 2c3600ff1b8ac651327ebaf18207730413c555b1 Mon Sep 17 00:00:00 2001 From: Ksenija Stanojevic Date: Wed, 8 Dec 2021 17:34:21 -0800 Subject: [PATCH 2/2] Update log error message --- cloudinit/util.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cloudinit/util.py b/cloudinit/util.py index 7556e155a16..2e1cd2154af 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1752,12 +1752,10 @@ def mount_cb(device, callback, data=None, mtype=None, mountpoint = tmpd break except (IOError, OSError) as exc: - stderr = "Stderr: mount: unknown filesystem type 'ntfs'" - if stderr in str(exc): - LOG.debug("No support for mounting ntfs.") - else: - LOG.debug("Failed mount of '%s' as '%s': %s", - device, mtype, exc) + LOG.debug("Failed to mount device: '%s' with type: '%s' " + "using mount command: '%s', " + "which caused exception: %s", + device, mtype, ' '.join(mountcmd), exc) failure_reason = exc if not mountpoint: raise MountFailedError("Failed mounting %s to %s due to: %s" %