@timeout(30)
def wait_for_marathon():
    marathon_service = get_marathon_connection_string()
    while True:
        print 'Connecting to marathon on %s' % marathon_service
        try:
            response = requests.get(
                'http://%s/ping' % marathon_service, timeout=2)
        except (
            requests.exceptions.ConnectionError,
            requests.exceptions.Timeout,
        ):
            time.sleep(2)
            continue
        if response.status_code == 200:
            print "Marathon is up and running!"
            break
Blocks until marathon is up
dataset/ETHPy150Open thefactory/marathon-python/itests/itest_utils.py/wait_for_marathon