How to use the oncall.utils.read_config function in oncall

To help you get started, we’ve selected a few oncall examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linkedin / oncall / ops / entrypoint.py View on Github external
def main():
    oncall_config = read_config(
        os.environ.get('ONCALL_CFG_PATH', '/home/oncall/config/config.yaml'))
    mysql_config = oncall_config['db']['conn']['kwargs']

    # It often takes several seconds for MySQL to start up. oncall dies upon start
    # if it can't immediately connect to MySQL, so we have to wait for it.
    wait_for_mysql(mysql_config)

    if 'DOCKER_DB_BOOTSTRAP' in os.environ:
        if not os.path.exists(initializedfile):
            initialize_mysql_schema(mysql_config)

    os.execv('/usr/bin/uwsgi',
             ['', '--yaml', '/home/oncall/daemons/uwsgi.yaml:prod'])