Use as the argument name for for clarity

This commit is contained in:
Brett Sun 2016-12-07 15:31:27 +01:00 committed by Sylvain Bellemare
parent ad65e86131
commit b51a59e503
2 changed files with 8 additions and 8 deletions

View File

@ -58,15 +58,15 @@ def drop_database(connection, dbname):
raise NotImplementedError
def init_database(conn=None, dbname=None):
def init_database(connection=None, dbname=None):
"""Initialize the configured backend for use with BigchainDB.
Creates a database with :attr:`dbname` with any required tables
and supporting indexes.
Args:
conn (:class:`~bigchaindb.backend.connection.Connection`): an existing
connection to use to initialize the database.
connection (:class:`~bigchaindb.backend.connection.Connection`): an
existing connection to use to initialize the database.
Creates one if not given.
dbname (str): the name of the database to create.
Defaults to the database name given in the BigchainDB
@ -77,9 +77,9 @@ def init_database(conn=None, dbname=None):
given :attr:`dbname` already exists as a database.
"""
conn = conn or connect()
connection = connection or connect()
dbname = dbname or bigchaindb.config['database']['name']
create_database(conn, dbname)
create_tables(conn, dbname)
create_indexes(conn, dbname)
create_database(connection, dbname)
create_tables(connection, dbname)
create_indexes(connection, dbname)

View File

@ -138,7 +138,7 @@ def _run_init():
# Try to access the keypair, throws an exception if it does not exist
b = bigchaindb.Bigchain()
schema.init_database(b.connection)
schema.init_database(connection=b.connection)
logger.info('Create genesis block.')
b.create_genesis_block()