From eec4861c3613135d431389047b34400ab00d363f Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 21:03:12 +0200 Subject: [PATCH] lvol: honor check_mode on thinpool (#2935) (#2939) * lvol: support check_mode on thinpool * add changelog * Add %s when needed * correct changelog sentence Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit b2b487753264417b161f9299d7386d71a1f857cf) Co-authored-by: Amin Vakil --- .../fragments/2935-lvol-support_check_mode_thinpool.yml | 3 +++ plugins/modules/system/lvol.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/2935-lvol-support_check_mode_thinpool.yml diff --git a/changelogs/fragments/2935-lvol-support_check_mode_thinpool.yml b/changelogs/fragments/2935-lvol-support_check_mode_thinpool.yml new file mode 100644 index 0000000000..3efbe59860 --- /dev/null +++ b/changelogs/fragments/2935-lvol-support_check_mode_thinpool.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - lvol - honor ``check_mode`` on thinpool (https://github.com/ansible-collections/community.general/issues/2934). diff --git a/plugins/modules/system/lvol.py b/plugins/modules/system/lvol.py index fafa7db38a..e8b0ab838b 100644 --- a/plugins/modules/system/lvol.py +++ b/plugins/modules/system/lvol.py @@ -471,9 +471,9 @@ def main(): if size_opt == 'l': module.fail_json(changed=False, msg="Thin volume sizing with percentage not supported.") size_opt = 'V' - cmd = "%s %s -n %s -%s %s%s %s -T %s/%s" % (lvcreate_cmd, yesopt, lv, size_opt, size, size_unit, opts, vg, thinpool) + cmd = "%s %s %s -n %s -%s %s%s %s -T %s/%s" % (lvcreate_cmd, test_opt, yesopt, lv, size_opt, size, size_unit, opts, vg, thinpool) elif thinpool and not lv: - cmd = "%s %s -%s %s%s %s -T %s/%s" % (lvcreate_cmd, yesopt, size_opt, size, size_unit, opts, vg, thinpool) + cmd = "%s %s %s -%s %s%s %s -T %s/%s" % (lvcreate_cmd, test_opt, yesopt, size_opt, size, size_unit, opts, vg, thinpool) else: cmd = "%s %s %s -n %s -%s %s%s %s %s %s" % (lvcreate_cmd, test_opt, yesopt, lv, size_opt, size, size_unit, opts, vg, pvs) rc, dummy, err = module.run_command(cmd)