From 08fb24f94777362ff86d469ecfb49ac37862b3bc Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 1 Feb 2017 08:54:06 -0600 Subject: [PATCH] make helper function private --- salt/modules/selinux.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/selinux.py b/salt/modules/selinux.py index 0afe1ad56e..d29faedf40 100644 --- a/salt/modules/selinux.py +++ b/salt/modules/selinux.py @@ -345,7 +345,7 @@ def _context_string_to_dict(context): return ret -def filetype_id_to_string(filetype='a'): +def _filetype_id_to_string(filetype='a'): ''' Translates SELinux filetype single-letter representation to a more human-readable version (which is also used in `semanage fcontext -l`). @@ -386,7 +386,7 @@ def fcontext_get_policy(name, filetype=None, sel_type=None, sel_user=None, sel_l 'sel_role': '[^:]+', # se_role for file context is always object_r 'sel_type': sel_type or '[^:]+', 'sel_level': sel_level or '[^:]+'} - cmd_kwargs['filetype'] = '[[:alpha:] ]+' if filetype is None else filetype_id_to_string(filetype) + 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)