From 5cb40a86058c52692ad0c4df41e7596349367335 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Sat, 11 Feb 2023 11:53:22 -0300 Subject: [PATCH] Allow servicedelegation_normalize_principals to accept simple strings The function servicedelegation_normalize_principals acn be used to normalize principals, but would work only on list or tuples. With this patch a simple string can be passed as the 'principal' argument and will also be normalized. --- plugins/module_utils/ansible_freeipa_module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index 1fe38ef959..ff4fdcb3c0 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -733,6 +733,8 @@ def _check_exists(module, _type, name): ipa_realm = module.ipa_get_realm() _principal = [] + if not isinstance(principal, (list, tuple)): + principal = [principal] for _princ in principal: princ = _princ realm = ipa_realm