def get_selinux_context(path):
    '''
    Get an SELinux context from a given path

    CLI Example:

    .. code-block:: bash

        salt '*' file.get_selinux_context /etc/hosts
    '''
    out = __salt__['cmd.run'](['ls', '-Z', path], python_shell=False)

    try:
        ret = re.search(r'\w+:\w+:\w+:\w+', out).group(0)
    except __HOLE__:
        ret = (
            'No selinux context information is available for {0}'.format(path)
        )

    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/get_selinux_context