def fcontext_policy_absent(name, filetype='a', sel_type=None, sel_user=None, sel_level=None):
    '''
    .. versionadded:: 2017.7.0

    Makes sure an SELinux file context policy for a given filespec
    (name), filetype and SELinux context type is absent.

    name
        filespec of the file or directory. Regex syntax is allowed.

    filetype
        The SELinux filetype specification. Use one of [a, f, d, c, b,
        s, l, p]. See also `man semanage-fcontext`. Defaults to 'a'
        (all files).

    sel_type
        The SELinux context type. There are many.

    sel_user
        The SELinux user.

    sel_level
        The SELinux MLS range.
    '''
    ret = {'name': name, 'result': False, 'changes': {}, 'comment': ''}
    new_state = {}
    old_state = {}
    current_state = __salt__['selinux.fcontext_get_policy'](
            name=name,
            filetype=filetype,
            sel_type=sel_type,
            sel_user=sel_user,
            sel_level=sel_level)
    if not current_state:
        ret.update({'result': True,
                    'comment': 'SELinux policy for "{0}" already absent '.format(name) +
                               'with specified filetype "{0}" and sel_type "{1}".'.format(
                                        filetype,
                                        sel_type)})
        return ret
    else:
        old_state.update({name: current_state})
    ret['changes'].update({'old': old_state, 'new': new_state})
    if __opts__['test']:
        ret.update({'result': None})
    else:
        remove_ret = __salt__['selinux.fcontext_delete_policy'](
                name=name,
                filetype=filetype,
                sel_type=sel_type or current_state['sel_type'],
                sel_user=sel_user,
                sel_level=sel_level)
        if remove_ret['retcode'] != 0:
            ret.update({'comment': 'Error removing policy: {0}'.format(remove_ret)})
        else:
            ret.update({'result': True})
    return ret
def fcontext_policy_absent ( name , filetype = 'a' , sel_type = None , sel_user = None , sel_level = None ) : ret = { 'name' : name , 'result' : False , 'changes' : { } , 'comment' : '' } new_state = { } old_state = { } current_state = __salt__ [ 'selinux.fcontext_get_policy' ] ( name = name , filetype = filetype , sel_type = sel_type , sel_user = sel_user , sel_level = sel_level ) if not current_state : ret . update ( { 'result' : True , 'comment' : 'SELinux policy for "{0}" already absent ' . format ( name ) + 'with specified filetype "{0}" and sel_type "{1}".' . format ( filetype , sel_type ) } ) return ret else : old_state . update ( { name : current_state } ) ret [ 'changes' ] . update ( { 'old' : old_state , 'new' : new_state } ) if __opts__ [ 'test' ] : ret . update ( { 'result' : None } ) else : remove_ret = __salt__ [ 'selinux.fcontext_delete_policy' ] ( name = name , filetype = filetype , sel_type = sel_type or current_state [ 'sel_type' ] , sel_user = sel_user , sel_level = sel_level ) if remove_ret [ 'retcode' ] != 0 : ret . update ( { 'comment' : 'Error removing policy: {0}' . format ( remove_ret ) } ) else : ret . update ( { 'result' : True } ) return ret
.. versionadded:: 2017.7.0

    Makes sure an SELinux file context policy for a given filespec
    (name), filetype and SELinux context type is absent.

    name
        filespec of the file or directory. Regex syntax is allowed.

    filetype
        The SELinux filetype specification. Use one of [a, f, d, c, b,
        s, l, p]. See also `man semanage-fcontext`. Defaults to 'a'
        (all files).

    sel_type
        The SELinux context type. There are many.

    sel_user
        The SELinux user.

    sel_level
        The SELinux MLS range.