def wait_for_bot()

in source/services/lex-bot/lambda_function.py [0:0]


def wait_for_bot(bot_id):
    response = client.describe_bot(botId=bot_id)
    bot_status = response["botStatus"]
    while bot_status == "Creating":
        sleep(1)
        response = client.describe_bot(botId=bot_id)
        bot_status = response["botStatus"]
    if bot_status != "Available":
        logger.error(response)
        raise RuntimeError("Failed to create Lex bot.")