Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'])