mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Rework safety check on size arguments for when LV doesn't exist (#3681)
* Rework safety check on size arguments for when LV doesn't exist * Update changelogs/fragments/3681-lvol-fix-create.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Jake Reynolds <jake.reynolds@bidfx.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
6f47ddc29f
commit
352047314b
2 changed files with 4 additions and 1 deletions
2
changelogs/fragments/3681-lvol-fix-create.yml
Normal file
2
changelogs/fragments/3681-lvol-fix-create.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- lvol - allows logical volumes to be created with certain size arguments prefixed with ``+`` to preserve behavior of older versions of this module (https://github.com/ansible-collections/community.general/issues/3665).
|
|
@ -451,6 +451,7 @@ def main():
|
||||||
if this_lv is None:
|
if this_lv is None:
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if size_operator is not None:
|
if size_operator is not None:
|
||||||
|
if size_operator == "-" or (size_whole not in ["VG", "PVS", "FREE", "ORIGIN", None]):
|
||||||
module.fail_json(msg="Bad size specification of '%s%s' for creating LV" % (size_operator, size))
|
module.fail_json(msg="Bad size specification of '%s%s' for creating LV" % (size_operator, size))
|
||||||
# Require size argument except for snapshot of thin volumes
|
# Require size argument except for snapshot of thin volumes
|
||||||
if (lv or thinpool) and not size:
|
if (lv or thinpool) and not size:
|
||||||
|
|
Loading…
Reference in a new issue