From 141c6d0d9d3329baf5a1e8e6deda70d63335f42f Mon Sep 17 00:00:00 2001 From: Thomas Krahn Date: Fri, 21 Jul 2017 23:39:43 +0200 Subject: [PATCH] ipa_sudorule: Fix bug: get_sudorule_diff() takes exactly 2 arguments (3 given) (#21150) --- .../modules/identity/ipa/ipa_sudorule.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/ansible/modules/identity/ipa/ipa_sudorule.py b/lib/ansible/modules/identity/ipa/ipa_sudorule.py index 74f4a3c2d9e..60687543f5a 100644 --- a/lib/ansible/modules/identity/ipa/ipa_sudorule.py +++ b/lib/ansible/modules/identity/ipa/ipa_sudorule.py @@ -247,21 +247,6 @@ def get_sudorule_dict(cmdcategory=None, description=None, hostcategory=None, ipa return data -def get_sudorule_diff(ipa_sudorule, module_sudorule): - data = [] - for key in module_sudorule.keys(): - module_value = module_sudorule.get(key, None) - ipa_value = ipa_sudorule.get(key, None) - if isinstance(ipa_value, list) and not isinstance(module_value, list): - module_value = [module_value] - if isinstance(ipa_value, list) and isinstance(module_value, list): - ipa_value = sorted(ipa_value) - module_value = sorted(module_value) - if ipa_value != module_value: - data.append(key) - return data - - def category_changed(module, client, category_name, ipa_sudorule): if ipa_sudorule.get(category_name, None) == ['all']: if not module.check_mode: @@ -304,7 +289,7 @@ def ensure(module, client): if not module.check_mode: ipa_sudorule = client.sudorule_add(name=name, item=module_sudorule) else: - diff = get_sudorule_diff(client, ipa_sudorule, module_sudorule) + diff = client.get_diff(ipa_sudorule, module_sudorule) if len(diff) > 0: changed = True if not module.check_mode: