# Path: tokenserver/util.py
# def find_config_file(*paths):
#     ini_files = []
#     ini_files.append(os.environ.get('TOKEN_INI'))
#     ini_files.extend(paths)
#     ini_files.extend((
#         '/data/tokenserver/token-prod.ini',
#         '/etc/mozilla-services/token/production.ini',
#     ))
#     for ini_file in ini_files:
#         if ini_file is not None:
#             ini_file = os.path.abspath(ini_file)
#             if os.path.exists(ini_file):
#                 return ini_file
#     raise RuntimeError("Could not locate tokenserver ini file")


import os
import sys
from alembic import context
from logging.config import fileConfig
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
from tokenserver.util import find_config_file
from mozsvc.config import load_into_settings
# flake8: noqa

# ensure that the containing module is on sys.path
# this is a hack for using alembic in our built virtualenv.
mod_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")
if mod_dir not in sys.path:
    sys.path.append(mod_dir)




# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)


ini_file = find_config_file(config.get_main_option("token_ini"))
settings = {}

# Path: tokenserver/util.py
# def find_config_file(*paths):
#     ini_files = []
#     ini_files.append(os.environ.get('TOKEN_INI'))
#     ini_files.extend(paths)
#     ini_files.extend((
#         '/data/tokenserver/token-prod.ini',
#         '/etc/mozilla-services/token/production.ini',
#     ))
#     for ini_file in ini_files:
#         if ini_file is not None:
#             ini_file = os.path.abspath(ini_file)
#             if os.path.exists(ini_file):
#                 return ini_file
#     raise RuntimeError("Could not locate tokenserver ini file")


# Path: tokenserver/assignment/sqlnode/migrations/env.py
import os
import sys
from alembic import context
from logging.config import fileConfig
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
from tokenserver.util import find_config_file
from mozsvc.config import load_into_settings

# flake8: noqa

# ensure that the containing module is on sys.path
# this is a hack for using alembic in our built virtualenv.
mod_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")
if mod_dir not in sys.path:
    sys.path.append(mod_dir)




# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)


ini_file = find_config_file(config.get_main_option("token_ini"))
settings = {}

load_into_settings(ini_file, settings)