def getSubConnectionsByConnectionKey(self, service_connection_key):

        def gotResult(rows):
            def gotSubConns(results):
                if all( [ r[0] for r in results ] ):
                    return [ r[1] for r in results ]
                else:
                    return defer.fail('Error retrieving one or more subconnections: %s' % str(results))

            defs = [ self.getSubConnection(r['provider_nsa'], r['connection_id']) for r in rows ]
            return defer.DeferredList(defs).addCallback(gotSubConns)

        dbconfig = database.Registry.getConfig()
        d = dbconfig.select('sub_connections', where=['service_connection_id = ?', service_connection_key], select='provider_nsa, connection_id')
        d.addCallback(gotResult)
        return d
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/aggregator.py/Aggregator.getSubConnectionsByConnectionKey/original