← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~jasonzio/cloud-init:fixmounterrormatch into cloud-init:master

 

Jason Zions has proposed merging ~jasonzio/cloud-init:fixmounterrormatch into cloud-init:master.

Commit message:
Accept variation in error msg from mount for ntfs volumes

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~jasonzio/cloud-init/+git/cloud-init/+merge/357669

Fixes lp:1799338 by omitting the prefix of the error message from the text-to-match. This skips the part of the error message that differs between RHEL and SUSE without introducing a regexp match, which would be needlessly expensive in this case.
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~jasonzio/cloud-init:fixmounterrormatch into cloud-init:master.
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index d0358e9..e9793cf 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -707,7 +707,7 @@ def can_dev_be_reformatted(devpath, preserve_ntfs):
         file_count = util.mount_cb(cand_path, count_files, mtype="ntfs",
                                    update_env_for_mount={'LANG': 'C'})
     except util.MountFailedError as e:
-        if "mount: unknown filesystem type 'ntfs'" in str(e):
+        if "unknown filesystem type 'ntfs'" in str(e):
             return True, (bmsg + ' but this system cannot mount NTFS,'
                           ' assuming there are no important files.'
                           ' Formatting allowed.')

Follow ups