diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/sources/DataSourceAzure.py | 1 | ||||
-rw-r--r-- | cloudinit/util.py | 26 |
2 files changed, 17 insertions, 10 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index 923644e1..863a06b5 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -1596,6 +1596,7 @@ def can_dev_be_reformatted(devpath, preserve_ntfs): count_files, mtype="ntfs", update_env_for_mount={"LANG": "C"}, + log_error=False, ) except util.MountFailedError as e: evt.description = "cannot mount ntfs" diff --git a/cloudinit/util.py b/cloudinit/util.py index b0d2ddb0..7651ae67 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1908,7 +1908,12 @@ def mounts(): def mount_cb( - device, callback, data=None, mtype=None, update_env_for_mount=None + device, + callback, + data=None, + mtype=None, + update_env_for_mount=None, + log_error=True, ): """ Mount the device, call method 'callback' passing the directory @@ -1968,15 +1973,16 @@ def mount_cb( mountpoint = tmpd break except (IOError, OSError) as exc: - LOG.debug( - "Failed to mount device: '%s' with type: '%s' " - "using mount command: '%s', " - "which caused exception: %s", - device, - mtype, - " ".join(mountcmd), - exc, - ) + if log_error: + 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( |