mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ignore retcode on call to grep in selinux.py module
Fixes #43711 Returning an exit code of 1 is normal operation of grep when it does not find a match. This will happen every time this function is called by fcontext_policy_present to detirmine whether a selinux policy exists before creating it. Ignoring the retcode will prevent it from emitting an error when this happens.
This commit is contained in:
parent
47cd8723c6
commit
96c1ef48e6
1 changed files with 1 additions and 1 deletions
|
@ -463,7 +463,7 @@ def fcontext_get_policy(name, filetype=None, sel_type=None, sel_user=None, sel_l
|
|||
cmd_kwargs['filetype'] = '[[:alpha:] ]+' if filetype is None else filetype_id_to_string(filetype)
|
||||
cmd = 'semanage fcontext -l | egrep ' + \
|
||||
"'^{filespec}{spacer}{filetype}{spacer}{sel_user}:{sel_role}:{sel_type}:{sel_level}$'".format(**cmd_kwargs)
|
||||
current_entry_text = __salt__['cmd.shell'](cmd)
|
||||
current_entry_text = __salt__['cmd.shell'](cmd, ignore_retcode=True)
|
||||
if current_entry_text == '':
|
||||
return None
|
||||
ret = {}
|
||||
|
|
Loading…
Add table
Reference in a new issue