# Path: magnate/errors.py
# class MagnateConfigError(MagnateError):
#     """Raised when processing config files"""
#     pass
# 
# Path: magnate/logging.py



import itertools
import os.path
import yaml
from collections.abc import MutableMapping
from kitchen.iterutils import iterate
from voluptuous import All, Length, Schema, MultipleInvalid
from .errors import MagnateConfigError
from .logging import log
            # Dict value so merge the value
            dest[key] = _merge_mapping(dest[key], val, inplace=inplace)
        else:
            dest[key] = val

    mlog.debug('Leaving _merge_mapping()')
    return dest


def _read_config(paths, testing=False):
    """
    Read the config files listed in path and merge them into a dictionary.

    :arg paths: filenames to read and merge configuration data from.  The last
        files should override the first ones.
    :arg testing: If set to True, then use paths to data files that are
        appropriate for testing a source checkout.
    :rtype: ConfigObj, a dict-like object with helper methods for use as a config store
    :returns: Return the configuration dict
    """
    mlog.debug('Entered _read_config()')

    cfg = yaml.safe_load(DEFAULT_CONFIG)
    CONFIG_SCHEMA(cfg)

    for cfg_file in paths:
        try:
            with open(cfg_file, 'rb') as f:
                new_cfg = yaml.safe_load(f)
        except yaml.MarkedYAMLError as e:

# Path: magnate/errors.py
# class MagnateConfigError(MagnateError):
#     """Raised when processing config files"""
#     pass
# 
# Path: magnate/logging.py



# Path: magnate/config.py
import itertools
import os.path
import yaml
from collections.abc import MutableMapping
from kitchen.iterutils import iterate
from voluptuous import All, Length, Schema, MultipleInvalid
from .errors import MagnateConfigError
from .logging import log

            # Dict value so merge the value
            dest[key] = _merge_mapping(dest[key], val, inplace=inplace)
        else:
            dest[key] = val

    mlog.debug('Leaving _merge_mapping()')
    return dest


def _read_config(paths, testing=False):
    """
    Read the config files listed in path and merge them into a dictionary.

    :arg paths: filenames to read and merge configuration data from.  The last
        files should override the first ones.
    :arg testing: If set to True, then use paths to data files that are
        appropriate for testing a source checkout.
    :rtype: ConfigObj, a dict-like object with helper methods for use as a config store
    :returns: Return the configuration dict
    """
    mlog.debug('Entered _read_config()')

    cfg = yaml.safe_load(DEFAULT_CONFIG)
    CONFIG_SCHEMA(cfg)

    for cfg_file in paths:
        try:
            with open(cfg_file, 'rb') as f:
                new_cfg = yaml.safe_load(f)
        except yaml.MarkedYAMLError as e:

            raise MagnateConfigError('Config error parsing {}:\n{}'.format(cfg_file, e))