mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-28 02:14:43 +00:00
ipapermission: Allow execution of plugin in client host.
Update permission README file and add tests for executing plugin with
`ipaapi_context` set to `client`.
A new test playbook can be found at:
tests/permission/test_permission_client_context.yml
The new test file can be executed in a FreeIPA client host that is
not a server. In this case, it should be defined in the `ipaclients`
group, in the inventory file.
Due to differences in data returned when running in a client context,
some values had to be modified so that comparision works and an
unnecessary call to IPA API is executed.
This commit is contained in:
@@ -371,6 +371,10 @@ def main():
|
||||
for _member, _member_change in check_members.items():
|
||||
if _member_change is not None:
|
||||
_res_list = res_find[_member]
|
||||
# if running in a client context, data may be
|
||||
# returned as a tuple instead of a list.
|
||||
if isinstance(_res_list, tuple):
|
||||
_res_list = list(_res_list)
|
||||
_new_set = set(_res_list + _member_change)
|
||||
if _new_set != set(_res_list):
|
||||
member_attrs[_member] = list(_new_set)
|
||||
|
||||
Reference in New Issue
Block a user