mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-21 08:11:12 +00:00
sefcontext: flush in-process matchpathcon cache (#11812)
* fix sefcontext: flush in-process matchpathcon cache after changes Fixes https://github.com/ansible-collections/community.general/issues/888 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * update changelog fragment with PR number and URL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -280,6 +280,10 @@ def semanage_fcontext_modify(module, result, target, ftype, setype, substitute,
|
||||
if module._diff and prepared_diff:
|
||||
result["diff"] = dict(prepared=prepared_diff)
|
||||
|
||||
if changed and not module.check_mode:
|
||||
# Flush the in-process matchpathcon cache
|
||||
selinux.matchpathcon_fini()
|
||||
|
||||
module.exit_json(changed=changed, seuser=seuser, serange=serange, **result)
|
||||
|
||||
|
||||
@@ -327,6 +331,10 @@ def semanage_fcontext_delete(module, result, target, ftype, setype, substitute,
|
||||
if module._diff and prepared_diff:
|
||||
result["diff"] = dict(prepared=prepared_diff)
|
||||
|
||||
if changed and not module.check_mode:
|
||||
# Flush the in-process matchpathcon cache
|
||||
selinux.matchpathcon_fini()
|
||||
|
||||
module.exit_json(changed=changed, **result)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user