def setup_instance_group(context, request_spec, filter_properties):
 group_hosts = filter_properties.get('group_hosts')
 instance_uuid = request_spec.get('instance_properties', {}).get('uuid')
 group_info = _get_group_details(context, instance_uuid, group_hosts)
 if (group_info is not None):
  filter_properties['group_updated'] = True
  filter_properties['group_hosts'] = group_info.hosts
  filter_properties['group_policies'] = group_info.policies
  filter_properties['group_members'] = group_info.members

def setup_instance_group ( context , request_spec , filter_properties ) : group_hosts = filter_properties . get ( 'group_hosts' ) instance_uuid = request_spec . get ( 'instance_properties' , { } ) . get ( 'uuid' ) group_info = _get_group_details ( context , instance_uuid , group_hosts ) if ( group_info is not None ) : filter_properties [ 'group_updated' ] = True filter_properties [ 'group_hosts' ] = group_info . hosts filter_properties [ 'group_policies' ] = group_info . policies filter_properties [ 'group_members' ] = group_info . members
add group_hosts and group_policies fields to filter_properties dict based on instance uuids provided in request_spec .