~launchpad-pqm/launchpad/devel

10637.3.7 by Guilherme Salgado
merge devel
1
#!/usr/bin/python -S
9795.4.16 by Stuart Bishop
Simple script to block until cluster is synced
2
#
3
# Copyright 2010 Canonical Ltd.  This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
6
"""Block until the replication cluster synchronizes."""
7
8
__metaclass__ = type
9
__all__ = []
10
11
import _pythonpath
12
13
from optparse import OptionParser
14
14612.2.9 by William Grant
Other bits and pieces.
15
from lp.services.scripts import (
16
    db_options,
17
    logger_options,
18
    )
9795.4.16 by Stuart Bishop
Simple script to block until cluster is synced
19
from replication.helpers import sync
20
14612.2.9 by William Grant
Other bits and pieces.
21
9795.4.16 by Stuart Bishop
Simple script to block until cluster is synced
22
if __name__ == '__main__':
23
    parser = OptionParser()
24
    parser.add_option(
25
        "-t", "--timeout", dest="timeout", metavar="SECS", type="int",
26
        help="Abort if no sync after SECS seconds.", default=0)
27
    logger_options(parser)
28
    db_options(parser)
29
    options, args = parser.parse_args()
30
    sync(options.timeout)