Skip to content

Commit

Permalink
[module_base] Have _get_ansible_param_bool set the value to value_fal…
Browse files Browse the repository at this point in the history
…se if the parameter is present and false
  • Loading branch information
opoplawski committed Jan 11, 2024
1 parent 9fa524b commit a63e3e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/module_utils/module_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

# Copyright: (c) 2019, Frederic Bor <frederic.bor@wanadoo.fr>
# Copyright: (c) 2024, Orion Poplawski <orion@nwra.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
Expand Down Expand Up @@ -68,8 +69,10 @@ def _get_ansible_param_bool(self, obj, name, fname=None, force=False, value='yes
if self.params.get(name) is not None:
if self.params.get(name):
obj[fname] = value
elif force:
elif value_false is not None:
obj[fname] = value_false
elif force:
obj[fname] = None
elif force:
obj[fname] = value_false

Expand Down

0 comments on commit a63e3e2

Please sign in to comment.