~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/preflight.py

  • Committer: William Grant
  • Date: 2011-12-30 06:47:17 UTC
  • mto: This revision was merged to the branch mainline in revision 14610.
  • Revision ID: william.grant@canonical.com-20111230064717-n5re5t6we5w8o17z
Replace canonical.database usage everywhere, and format-imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
"""Confirm the database systems are ready to be patched as best we can."""
6
6
 
7
 
import _pythonpath
8
 
 
9
7
__all__ = [
10
8
    'DatabasePreflight',
11
9
    'KillConnectionsPreflight',
12
10
    'NoConnectionCheckPreflight',
13
11
    ]
14
12
 
 
13
import _pythonpath
15
14
 
16
15
from datetime import timedelta
17
16
from optparse import OptionParser
20
19
 
21
20
import psycopg2
22
21
 
23
 
from canonical.database.sqlbase import (
 
22
from lp.services.database.sqlbase import (
24
23
    connect,
25
24
    ISOLATION_LEVEL_AUTOCOMMIT,
26
25
    sqlvalues,
33
32
import replication.helpers
34
33
import upgrade
35
34
 
36
 
 
37
35
# Ignore connections by these users.
38
36
SYSTEM_USERS = frozenset(['postgres', 'slony', 'nagios', 'lagmon'])
39
37