import grp


def make_group_dict(gid):
    """Create dictionary from group record."""
    try:
        group_record = grp.getgrgid(gid)
    except KeyError:
        return False

    group_dict = {
        'name': group_record.gr_name,
        'passwd': group_record.gr_passwd,
        'gid': group_record.gr_gid,
    }
    return group_dict