'Query floating_ips that relate to list of router_ids with scope.
This is different than the regular get_floatingips in that it finds the
address scope of the fixed IP.  The router needs to know this to
distinguish it from other scopes.
There are a few redirections to go through to discover the address
scope from the floating ip.'

def _get_sync_floating_ips(self, context, router_ids):

    if (not router_ids):
        return []
    query = context.session.query(l3_models.FloatingIP, models_v2.SubnetPool.address_scope_id)
    query = query.join(models_v2.Port, (l3_models.FloatingIP.fixed_port_id == models_v2.Port.id))
    query = query.outerjoin(models_v2.Subnet, (models_v2.Subnet.network_id == models_v2.Port.network_id))
    query = query.filter((models_v2.Subnet.ip_version == 4))
    query = query.outerjoin(models_v2.SubnetPool, (models_v2.Subnet.subnetpool_id == models_v2.SubnetPool.id))
    query = query.filter(l3_models.FloatingIP.router_id.in_(router_ids))
    return [self._make_floatingip_dict_with_scope(*row) for row in self._unique_floatingip_iterator(query)]
