@defer.inlineCallbacks
    def queryRecursive(self, header, connection_ids, global_reservation_ids, request_info=None):

        log.msg((header.requester_nsa, connection_ids, global_reservation_ids) % 'QueryRecursive request from %s. CID: %s. GID: %s', system=LOG_SYSTEM)

        # the semantics for global reservation id and query recursive is extremely wonky, so we don't do it
        if global_reservation_ids:
            raise error.UnsupportedParameter("Global Reservation Id not supported in queryRecursive (has wonky-monkey-on-acid semantics, don't use it)")

        # recursive queries for all connections is a bad idea, say no to that
        if not connection_ids:
            raise error.MissingParameterError("At least one connection id must be specified, refusing to do recursive query for all connections")

        # because segmenting the requests is a PITA
        if len(connection_ids) > 1:
            raise error.UnsupportedParameter("Can only perform queryRecursive for a single connection id.")

        try:
            conn = yield self.getConnection(connection_ids[0])

            sub_connections = yield self.getSubConnectionsByConnectionKey(conn.id)

            cb_header = nsa.NSIHeader(header.requester_nsa, self.nsa_.urn(), header.correlation_id, reply_to=header.reply_to, security_attributes=header.security_attributes)
            self.query_requests[cb_header.correlation_id]  = (cb_header, conn, len(sub_connections) )

            defs = []
            for sc in sub_connections:
                provider = self.getProvider(sc.provider_nsa)
                sch = nsa.NSIHeader(self.nsa_.urn(), sc.provider_nsa, security_attributes=header.security_attributes)
                d = provider.queryRecursive(sch, [ sc.connection_id ] , None, request_info)
                d.addErrback(_logErrorResponse, 'queryRecursive', sc.provider_nsa, 'queryRecursive')
                defs.append(d)

                self.query_calls[sch.correlation_id] = (cb_header.correlation_id, None)

            results = yield defer.DeferredList(defs, consumeErrors=True)
            successes = [ r[0] for r in results ]
            if all(successes):
                # this just means we got an ack from all children
                defer.returnValue(None)

            else:
                n_success = sum( [ 1 for s in successes if s ] )
                log.msg('QueryRecursive failure. %i of %i connections successfully replied' % (n_success, len(defs)), system=LOG_SYSTEM)
                # we should really clear out the temporary state here...
                provider_urns = [ sc.provider_nsa for sc in sub_connections ]
                raise _createAggregateException('', 'queryRecursive', results, provider_urns, error.ConnectionError)

        except ValueError as e:
            log.msg('Error during queryRecursive request: %s' % str(e), system=LOG_SYSTEM)
            raise e
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/aggregator.py/Aggregator.queryRecursive/swapped operands of `%`