~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/replication/preamble.py

  • Committer: Steve Kowalik
  • Date: 2011-08-07 04:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 13626.
  • Revision ID: stevenk@ubuntu.com-20110807040552-mwnxo0flmhvl35e8
Correct the notification based on review comments, and remove request{,ed}
from the function names, switching to create{,d}.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python -S
2
2
#
3
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
3
# Copyright 2009 Canonical Ltd.  This software is licensed under the
4
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
5
 
6
6
"""Generate a preamble for slonik(1) scripts based on the current LPCONFIG.
11
11
 
12
12
import _pythonpath
13
13
 
 
14
import time
14
15
from optparse import OptionParser
15
 
import time
16
 
 
17
 
from lp.services import scripts
18
 
from lp.services.config import config
19
 
from lp.services.database.sqlbase import connect
 
16
 
 
17
from canonical.config import config
 
18
from canonical.database.sqlbase import connect
 
19
from canonical.launchpad import scripts
 
20
 
20
21
import replication.helpers
21
22
 
22
 
 
23
23
if __name__ == '__main__':
24
24
    parser = OptionParser()
25
25
    scripts.db_options(parser)
28
28
        parser.error("Too many arguments")
29
29
    scripts.execute_zcml_for_scripts(use_web_security=False)
30
30
 
31
 
    con = connect()
 
31
    con = connect(options.dbuser)
32
32
    print '# slonik(1) preamble generated %s' % time.ctime()
33
33
    print '# LPCONFIG=%s' % config.instance_name
34
34
    print
35
35
    print replication.helpers.preamble(con)
 
36