~launchpad-pqm/launchpad/devel

10637.3.1 by Guilherme Salgado
Use the default python version instead of a hard-coded version
1
#!/usr/bin/python -S
10635.4.1 by Maris Fogels
Added a trivial script for checking the current database schema number.
2
# Copyright 2010 Canonical Ltd.  All rights reserved.
3
4
"""
5
Check that the database revision of the current branch matches the current
6
database schema number.
7
"""
8
10635.4.2 by Maris Fogels
Added a simple script and makefile check to ensure that the current database schema is up-to-date before we try and fire up the application server.
9
import _pythonpath
10
import sys
11
12
from canonical.database.revision import (
13
    confirm_dbrevision_on_startup, InvalidDatabaseRevision)
14
15
try:
16
    confirm_dbrevision_on_startup()
17
except InvalidDatabaseRevision, err:
18
    print "Oops, we are trying to use an invalid database revision!"
19
    print err
20
    sys.exit(1)
21
else:
10635.4.4 by Maris Fogels
Missing newline
22
    sys.exit(0)