def fcontext_policy_is_applied(name, recursive=False):
 cmd = 'restorecon -n -v '
 if recursive:
  cmd += '-R '
 cmd += re.escape(name)
 return __salt__['cmd.run_all'](cmd).get('stdout')

def fcontext_policy_is_applied ( name , recursive = False ) : cmd = 'restorecon -n -v ' if recursive : cmd += '-R ' cmd += re . escape ( name ) return __salt__ [ 'cmd.run_all' ] ( cmd ) . get ( 'stdout' )
returns an empty string if the selinux policy for a given filespec is applied .