Return (extremely verbose) map of FACLs on specified file(s)

    CLI Examples:

    .. code-block:: bash

        salt '*' acl.getfacl /tmp/house/kitchen
        salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
        salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom recursive=True

def getfacl(*args, **kwargs):
    '''
    Return (extremely verbose) map of FACLs on specified file(s)

    CLI Examples:

    .. code-block:: bash

        salt '*' acl.getfacl /tmp/house/kitchen
        salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
        salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom recursive=True
    '''
    recursive = kwargs.pop('recursive', False)

    _raise_on_no_files(*args)

    ret = {}
    cmd = 'getfacl --absolute-names'
    if recursive:
        cmd += ' -R'
    for dentry in args:
        cmd += ' "{0}"'.format(dentry)
    out = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
    dentry = ''
    for line in out:
        if not line:
            continue
        elif line.startswith('getfacl'):
            continue
        elif line.startswith('#'):
            comps = line.replace('# ', '').split(': ')
            if comps[0] == 'file':
                dentry = comps[1]
                ret[dentry] = {'comment': {},
                               'user': [],
                               'group': []}
            ret[dentry]['comment'][comps[0]] = comps[1]
            if comps[0] == 'flags':
                flags = list(comps[1])
                if flags[0] == 's':
                    ret[dentry]['suid'] = True
                if flags[1] == 's':
                    ret[dentry]['sgid'] = True
                if flags[2] == 't':
                    ret[dentry]['sticky'] = True
        else:
            vals = _parse_acl(acl=line,
                              user=ret[dentry]['comment']['owner'],
                              group=ret[dentry]['comment']['group'])
            acl_type = vals['type']
            del vals['type']
            for entity in ('user', 'group'):
                if entity in vals:
                    usergroup = vals[entity]
                    del vals[entity]
                    if acl_type == 'acl':
                        ret[dentry][entity].append({usergroup: vals})
                    elif acl_type == 'default':
                        if 'defaults' not in ret[dentry]:
                            ret[dentry]['defaults'] = {}
                        if entity not in ret[dentry]['defaults']:
                            ret[dentry]['defaults'][entity] = []
                        ret[dentry]['defaults'][entity].append({usergroup: vals})
            for entity in ('other', 'mask'):
                if entity in vals:
                    del vals[entity]
                    if acl_type == 'acl':
                        ret[dentry][entity] = [{"": vals}]
                    elif acl_type == 'default':
                        if 'defaults' not in ret[dentry]:
                            ret[dentry]['defaults'] = {}
                        ret[dentry]['defaults'][entity] = [{"": vals}]

    return ret