Skip to content

Commit

Permalink
Allow servicedelegation_normalize_principals to accept simple strings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rjeffman committed Feb 11, 2023
1 parent bbefbb6 commit 5cb40a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/module_utils/ansible_freeipa_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cb40a8

Please sign in to comment.