~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/replication/initialize.py

[r=stub][bug=842304] Make canonical.database.sqlbase.connect()'s user
        argument optional; the default is usually sane now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    log.info('Duplicating database schema')
43
43
 
44
44
    master_cs = ConnectionString(config.database.rw_main_master)
45
 
    master_cs.user = options.dbuser
46
45
    slave1_cs = ConnectionString(config.database.rw_main_slave)
47
 
    slave1_cs.user = options.dbuser
48
46
 
49
47
    # We can't use pg_dump to replicate security as not all of the roles
50
48
    # may exist in the slave databases' clusters yet.
154
152
 
155
153
    # Generate lists of sequences and tables for our replication sets.
156
154
    log.debug("Connecting as %s" % options.dbuser)
157
 
    con = connect(options.dbuser)
 
155
    con = connect()
158
156
    con.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
159
157
    global cur
160
158
    cur = con.cursor()