~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
15
from canonical.launchpad.scripts import logger_options, db_options
16
from replication.helpers import sync
17
18
if __name__ == '__main__':
19
    parser = OptionParser()
20
    parser.add_option(
21
        "-t", "--timeout", dest="timeout", metavar="SECS", type="int",
22
        help="Abort if no sync after SECS seconds.", default=0)
23
    logger_options(parser)
24
    db_options(parser)
25
    options, args = parser.parse_args()
26
    sync(options.timeout)