~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/check-db-revision.py

  • Committer: Julian Edwards
  • Date: 2011-07-28 20:46:18 UTC
  • mfrom: (13553 devel)
  • mto: This revision was merged to the branch mainline in revision 13555.
  • Revision ID: julian.edwards@canonical.com-20110728204618-tivj2wx2oa9s32bx
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python -S
 
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
 
 
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:
 
22
    sys.exit(0)