Blame SOURCES/ansible-freeipa-1.8.3-ipaconfig-Fix-fail_json-calls_rhbz#2135753.patch

9b9c8d
From 4da89de1d41a752e561d17f628dd6c2cbda3f326 Mon Sep 17 00:00:00 2001
9b9c8d
From: Rafael Guterres Jeffman <rjeffman@redhat.com>
9b9c8d
Date: Wed, 21 Sep 2022 10:10:52 -0300
9b9c8d
Subject: [PATCH] ipaconfig: Fix fail_json calls.
9b9c8d
9b9c8d
Ansible's fail_json() method required that the message paramater was
9b9c8d
passed with a keyword parameter, rather than a positional one. Although
9b9c8d
this seems to work with ansible-core 2.13+, it might not work with
9b9c8d
previous versions of Ansible.
9b9c8d
9b9c8d
This patch fixes the behaviour for all supported Ansible versions.
9b9c8d
---
9b9c8d
 plugins/modules/ipaconfig.py | 7 ++++---
9b9c8d
 1 file changed, 4 insertions(+), 3 deletions(-)
9b9c8d
9b9c8d
diff --git a/plugins/modules/ipaconfig.py b/plugins/modules/ipaconfig.py
9b9c8d
index b0b4062..87810b2 100644
9b9c8d
--- a/plugins/modules/ipaconfig.py
9b9c8d
+++ b/plugins/modules/ipaconfig.py
9b9c8d
@@ -533,13 +533,14 @@ def main():
9b9c8d
             required_sid = any([netbios_name, add_sids])
9b9c8d
             if required_sid and not enable_sid:
9b9c8d
                 ansible_module.fail_json(
9b9c8d
-                    "'enable-sid: yes' required for 'netbios_name' "
9b9c8d
-                    "and 'add-sids'."
9b9c8d
+                    msg="'enable-sid: yes' required for 'netbios_name' "
9b9c8d
+                        "and 'add-sids'."
9b9c8d
                 )
9b9c8d
             if enable_sid:
9b9c8d
                 if not has_enable_sid:
9b9c8d
                     ansible_module.fail_json(
9b9c8d
-                        "This version of IPA does not support 'enable-sid'.")
9b9c8d
+                        msg="This version of IPA does not support enable-sid."
9b9c8d
+                    )
9b9c8d
                 if (
9b9c8d
                     netbios_name
9b9c8d
                     and netbios_name == get_netbios_name(ansible_module)
9b9c8d
-- 
9b9c8d
2.37.3
9b9c8d