summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-04-04 15:02:00 -0400
committerScott Moser <smoser@ubuntu.com>2016-04-04 15:02:00 -0400
commit3de63003f63801a046b2526b264caa92371d8e9f (patch)
tree14cba1de7e4f877a613ab72f37ddd6e57dbbf845
parente3138283fa5f4c3c2579ee54c8a160fda2c17473 (diff)
downloadvyos-cloud-init-3de63003f63801a046b2526b264caa92371d8e9f.tar.gz
vyos-cloud-init-3de63003f63801a046b2526b264caa92371d8e9f.zip
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
-rw-r--r--ChangeLog1
-rw-r--r--cloudinit/config/cc_disk_setup.py6
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: