~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/unautovacuumable.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-09-26 06:30:07 UTC
  • mto: This revision was merged to the branch mainline in revision 14049.
  • Revision ID: jeroen.vermeulen@canonical.com-20110926063007-1fb5eelnidpnra9a
Fix lots of lint in recently-changed files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python -S
2
2
#
3
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
3
# Copyright 2009-2011 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
"""Disable autovacuum on all tables in the database and kill off
16
16
__metaclass__ = type
17
17
__all__ = []
18
18
 
19
 
# pylint: disable-msg=W0403
20
 
import _pythonpath
21
 
 
22
19
from distutils.version import LooseVersion
23
20
from optparse import OptionParser
24
21
import sys
25
22
import time
26
23
 
27
 
from canonical.database.sqlbase import connect
28
 
from canonical.launchpad.scripts import logger_options, db_options, logger
 
24
# pylint: disable-msg=W0403
 
25
import _pythonpath
 
26
 
 
27
from canonical.database.sqlbase import (
 
28
    connect,
 
29
    ISOLATION_LEVEL_AUTOCOMMIT,
 
30
    )
 
31
from canonical.launchpad.scripts import (
 
32
    db_options,
 
33
    logger,
 
34
    logger_options,
 
35
    )
29
36
 
30
37
 
31
38
def main():
42
49
 
43
50
    log.debug("Connecting")
44
51
    con = connect()
45
 
    con.set_isolation_level(0) # Autocommit
 
52
    con.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
46
53
    cur = con.cursor()
47
54
 
48
55
    cur.execute('show server_version')