mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 02:36:55 +00:00
[PR #10445/1f8b5eea backport][stable-11] cronvar: Handle empty value string properly (#10496)
cronvar: Handle empty value string properly (#10445)
* Fix empty value issue in cronvar
* Update changelog
* Update plugins/modules/cronvar.py
* Update changelogs/fragments/10445-cronvar-reject-empty-values.yml
* Update tests/integration/targets/cronvar/tasks/main.yml
* Update tests/integration/targets/cronvar/tasks/main.yml
* Accept empty strings on cronvar
* Update plugins/modules/cronvar.py
* Update main.yml
---------
(cherry picked from commit 1f8b5eea4c)
Co-authored-by: Giorgos Drosos <56369797+gdrosos@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
6dd19450bd
commit
9d8fac08bb
3 changed files with 21 additions and 0 deletions
|
|
@ -396,6 +396,8 @@ def main():
|
|||
old_value = cronvar.find_variable(name)
|
||||
|
||||
if ensure_present:
|
||||
if value == "" and old_value != "":
|
||||
value = '""'
|
||||
if old_value is None:
|
||||
cronvar.add_variable(name, value, insertbefore, insertafter)
|
||||
changed = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue