@classmethod
    def load_config_file(cls, filename, filetype=None, paths=None):
        if not paths:
            paths = ['.']
        if filetype is None:
            if (filename.lower().endswith('.yaml') or
                    filename.lower().endswith('.yml')):
                filetype = 'yaml'
            elif filename.lower().endswith('.json'):
                filetype = 'json'
            elif (filename.lower().endswith('.conf')
                  or filename.lower().endswith('.ini')):
                filetype = 'ini'
            else:
                filetype = 'yaml'
        data = cls._load_file(filename, paths)
        if data is None:
            raise ConfigurationError(
                "Cannot find or read config file: %s" % filename)
        try:
            loader = getattr(cls, "_load_%s_config" % filetype)
        except __HOLE__:
            raise ConfigurationError("Unknown config file type: %s" % filetype)
        return loader(data, filename=filename)
dataset/ETHPy150Open openstack/stacktach-winchester/winchester/config.py/ConfigManager.load_config_file