Returns: None if group wasn't found, otherwise a group object

def _common(kwargs):
    '''
    Returns: None if group wasn't found, otherwise a group object
    '''
    search_kwargs = {'name': kwargs['name']}
    if 'domain' in kwargs:
        domain = __salt__['keystoneng.get_entity'](
                          'domain', name=kwargs.pop('domain'))
        domain_id = domain.id if hasattr(domain, 'id') else domain
        search_kwargs['filters'] = {'domain_id': domain_id}
        kwargs['domain'] = domain

    return __salt__['keystoneng.group_get'](**search_kwargs)