예제 #1
0
 def setUp(self):
     log = logging.getLogger("setUp")
     log.debug("installing schema and test data")
     _install_schema_and_test_data()
     log.debug("creating database connection")
     self._connection = RealDictConnection(
         get_node_database_dsn(_node_name, _database_password,
                               _database_host, _database_port))
     log.debug("setup done")
 def setUp(self):
     log = logging.getLogger("setUp")
     log.debug("installing schema and test data")
     _install_schema_and_test_data()
     log.debug("creating database connection")
     self._connection = RealDictConnection(
         get_node_database_dsn(_node_name, 
                               _database_password, 
                               _database_host, 
                               _database_port))
     log.debug("setup done")
예제 #3
0
def get_node_databases():
    """
    return a dict of database connections keyed by node name
    """
    psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
    psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)

    node_databases = dict()
    node_database_list = zip(_node_names, _node_database_hosts,
                             _node_database_ports, _node_database_passwords)

    for name, host, port, password in node_database_list:

        # XXX: temporary expedient until boostrap is fixed
        host = 'localhost'
        dsn = get_node_database_dsn(name, password, host, port)
        connection = RealDictConnection(dsn)
        node_databases[name] = connection

    return node_databases
예제 #4
0
def get_node_databases():
    """
    return a dict of database connections keyed by node name
    """
    psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
    psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)

    node_databases = dict()
    node_database_list = zip(_node_names, 
                             _node_database_hosts,
                             _node_database_ports,
                             _node_database_passwords)

    for name, host, port, password in node_database_list:

        # XXX: temporary expedient until boostrap is fixed
        host='localhost'
        dsn = get_node_database_dsn(name, password, host, port)
        connection = RealDictConnection(dsn)
        node_databases[name] = connection

    return node_databases