ottoland
author Gregory Szorc <gps@mozilla.com>
Wed, 22 Apr 2015 11:57:04 -0700
changeset 360706 647dbc860b667d4784de497b18c490015ee2d9b4
parent 360484 3b8a10644a71ffe21fc02b21c1baaab7c1bd2b56
permissions -rwxr-xr-x
ansible: wait for Apache workers to drain instead of network connections Ansible's wait_for module waits for connections in TIME_WAIT state. This is not very usable since connections can linger in TIME_WAIT for minutes. Wait on Apache workers instead.

#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import sys

HERE = os.path.abspath(os.path.dirname(__file__))

def main(args):
    if 'VIRTUAL_ENV' not in os.environ:
        activate = os.path.join(HERE, 'venv', 'bin', 'activate_this.py')
        execfile(activate, dict(__file__=activate))
        sys.executable = os.path.join(HERE, 'venv', 'bin', 'python')

    from mach.main import Mach

    m = Mach(os.getcwd())

    m.define_category('autoland', 'Autoland',
        'Control and interact with Autoland', 50)
    import vcttesting.autoland_mach_commands

    return m.run(args)

if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))