Load the configuration file.

def get_config(config_path='/etc/record_recommender.yml', sentry=False):
    """Load the configuration file."""
    config = {}
    if os.path.exists(config_path):
        with open(config_path, 'rt') as f:
            config = yaml.safe_load(f.read())
    else:
        # TODO: Auto create config file.
        print("No config file at {}".format(config_path))

    es_password = os.environ.get('RECOMMENDER_ES_PASSWORD')
    if es_password:
        config.get('elasticsearch', {})['es_password'] = es_password

    sentry_os = os.environ.get('RECOMMENDER_SENTRY')
    if sentry_os:
        config['logging']['handlers']['sentry']['dsn'] = sentry_os
    elif config.get('sentry'):
        config['logging']['handlers']['sentry']['dsn'] = config.get('sentry')
    else:
        if config.get('logging.handlers.sentry'):
            config['logging']['handlers'].pop('sentry')

    return config