def get_sql_config(database_name):
    """Get SQL config from config file and return the dictionary
    """
    if not hasattr(config, 'mysql'):
        raise ETLConfigError('mysql not found in dataduct configs')

    if database_name not in config.mysql:
        raise ETLConfigError(
            'Config for hostname: %s not found' % database_name)

    sql_creds = config.mysql[database_name]
    sql_creds['DATABASE'] = database_name

    return sql_creds
dataset/ETHPy150Open coursera/dataduct/dataduct/data_access/connection.py/get_sql_config/original