From 96cd7fb2ad41201fb0fde67c72d9d1a7b2d7314c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 26 Aug 2024 12:25:14 +0200 Subject: Adding upstream version 2.17.3. Signed-off-by: Daniel Baumann --- lib/ansible/modules/debconf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/ansible/modules/debconf.py') diff --git a/lib/ansible/modules/debconf.py b/lib/ansible/modules/debconf.py index 779952e..259d92b 100644 --- a/lib/ansible/modules/debconf.py +++ b/lib/ansible/modules/debconf.py @@ -173,8 +173,6 @@ def set_selection(module, pkg, question, vtype, value, unseen): if unseen: cmd.append('-u') - if vtype == 'boolean': - value = value.lower() data = ' '.join([pkg, question, vtype, value]) return module.run_command(cmd, data=data) @@ -209,15 +207,17 @@ def main(): if vtype is None or value is None: module.fail_json(msg="when supplying a question you must supply a valid vtype and value") + # ensure we compare booleans supplied to the way debconf sees them (true/false strings) + if vtype == 'boolean': + value = to_text(value).lower() + # if question doesn't exist, value cannot match if question not in prev: changed = True else: existing = prev[question] - # ensure we compare booleans supplied to the way debconf sees them (true/false strings) if vtype == 'boolean': - value = to_text(value).lower() existing = to_text(prev[question]).lower() elif vtype == 'password': existing = get_password_value(module, pkg, question, vtype) -- cgit v1.2.3