def _load_section_from_config_file(self, config, config_filename, section):
        try:
            config_parsed = ConfigFile(config_filename).read_config_from_disk()
        except FileNotFoundError:
            sample_filename = join(config.get('root_directory'), 'conf', 'default_clusterrunner.conf')
            fs.create_dir(config.get('base_directory'))
            shutil.copy(sample_filename, config_filename)
            chmod(config_filename, ConfigFile.CONFIG_FILE_MODE)
            config_parsed = ConfigFile(config_filename).read_config_from_disk()

        if section not in config_parsed:
            raise InvalidConfigError('The config file {} does not contain a [{}] section'
                                     .format(config_filename, section))

        clusterrunner_config = config_parsed[section]
        whitelisted_file_keys = self._get_config_file_whitelisted_keys()
        for key in clusterrunner_config:
            if key not in whitelisted_file_keys:
                raise InvalidConfigError('The config file contains an invalid key: {}'.format(key))
            value = clusterrunner_config[key]

            self._cast_and_set(key, value, config)
Load a config file and copy all the values in a particular section to the Configuration singleton
dataset/ETHPy150Open box/ClusterRunner/app/util/conf/base_config_loader.py/BaseConfigLoader._load_section_from_config_file