@defer.inlineCallbacks
    def reserveFailed(self, header, connection_id, connection_states, err):

        log.msg('', system=LOG_SYSTEM)
        log.msg('reserveFailed from %s. Connection ID: %s. Error: %s' % (header.provider_nsa, connection_id, err), system=LOG_SYSTEM)

        if not header.correlation_id in self.reservations:
            msg = 'Unrecognized correlation id %s in reserveFailed. Connection ID %s. NSA %s' % (header.correlation_id, connection_id, header.provider_nsa)
            log.msg(msg, system=LOG_SYSTEM)
            raise error.ConnectionNonExistentError(msg)

        org_provider_nsa = self.reservations[header.correlation_id]['provider_nsa']
        if header.provider_nsa != org_provider_nsa:
            log.msg((header.provider_nsa, org_provider_nsa) % 'Provider NSA in header %s for reserveFailed does not match saved identity %s', system=LOG_SYSTEM)
            raise error.SecurityError('Provider NSA for connection does not match saved identity')

        resv_info = self.reservations.pop(header.correlation_id)

        service_connection_key = resv_info['service_connection_id']

        conn = yield self.getConnectionByKey(service_connection_key)
        if conn.reservation_state != state.RESERVE_FAILED: # since we can fail multiple times
            yield state.reserveFailed(conn)

        header = nsa.NSIHeader(conn.requester_nsa, self.nsa_.urn())
        self.parent_requester.reserveFailed(header, conn.connection_id, connection_states, err)
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/aggregator.py/Aggregator.reserveFailed/swapped operands of `%`