import platform
import grp


def GetGroupId(group):
    """
    On a Linux system attempt to get the GID value for a give 'group'. This uses
    a system call to obtain this data.

    :param group: Group name to lookup.
    :return: GID value if the group is found, otherwise None
    """
    if isinstance(group, int):
        return group
    if platform.system() != 'Linux':
        raise RuntimeError('GID lookup not support outside of Linux')
    try:
        return grp.getgrnam(group).gr_gid
    except KeyError:
        return None