From 3de63003f63801a046b2526b264caa92371d8e9f Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 4 Apr 2016 15:02:00 -0400 Subject: disk_setup: correctly send --force to mkfs on block devices Send the --force flag to mkfs or other filesystems when target is a block device. This fixes a general code flow issue where we were setting the --force flag. LP: #1548772 --- ChangeLog | 1 + cloudinit/config/cc_disk_setup.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 805df93b..df3f5f19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,7 @@ - FreeBSD: add support for installing packages, setting password and timezone. Change default user to 'freebsd'. [Ben Arblaster] - locale: list unsupported environment settings in warning (LP: #1558069) + - disk_setup: correctly send --force to mkfs on block devices (LP: #1548772) 0.7.6: - open 0.7.6 diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py index 0ecc2e4c..bbaf9646 100644 --- a/cloudinit/config/cc_disk_setup.py +++ b/cloudinit/config/cc_disk_setup.py @@ -847,9 +847,9 @@ def mkfs(fs_cfg): if label: fs_cmd.extend(["-L", label]) - # File systems that support the -F flag - if not fs_cmd and (overwrite or device_type(device) == "disk"): - fs_cmd.append(lookup_force_flag(fs_type)) + # File systems that support the -F flag + if overwrite or device_type(device) == "disk": + fs_cmd.append(lookup_force_flag(fs_type)) # Add the extends FS options if fs_opts: -- cgit v1.2.3