Remove a user from the group.

    CLI Example:

    .. code-block:: bash

         salt '*' group.deluser foo bar

    Removes a member user 'bar' from a group 'foo'. If group is not present
    then returns True.

def deluser(name, username):
    '''
    Remove a user from the group.

    CLI Example:

    .. code-block:: bash

         salt '*' group.deluser foo bar

    Removes a member user 'bar' from a group 'foo'. If group is not present
    then returns True.
    '''
    grp_info = __salt__['group.info'](name)

    if username not in grp_info['members']:
        return True

    # Note: pw exits with code 65 if group is unknown
    retcode = __salt__['cmd.retcode']('pw groupmod {0} -d {1}'.format(
        name, username), python_shell=False)

    return not retcode