Writes the provisioner's config file to disk and returns None.

        :return: None
977170
def write_config(self):
        
        template = util.render_template(
            self._get_config_template(), config_options=self.config_options)
        util.write_file(self.config_file, template)
821493
def _write_conf_file():
    
    with open(CONF_FILE, "w") as f:
        f.write(DEFAULT_PROFTPD_CONF)
        logger.debug("'%s' created.", CONF_FILE)
672952
def write_config(self):
        
        if not os.path.exists(os.path.dirname(self.config_file)):
            os.makedirs(os.path.dirname(self.config_file))
        with open(self.config_file, 'w') as f:
            f.write(json.dumps(self.config))
            f.close()
1218153
def write_config_value_to_file(key, value, config_path=None):
    
    if config_path is None:
        config_path = DEFAULT_CONFIG_PATH

    # Get existing config.
    config = _get_config_dict_from_file(config_path)

    # Add/update the key/value pair.
    config[key] = value

    # Create parent directories if they are missing.
    mkdir_parents(os.path.dirname(config_path))

    # Write the content
    with open(config_path, "w") as fh:
        json.dump(config, fh, sort_keys=True, indent=2)

    # Set 600 permissions on the config file.
    os.chmod(config_path, 33216)

    return get_config_value_from_file(key, config_path)
763035
def CopyConfig(self):
    
    newconf = self.MakeNewConfig()
    newconf.raw_data = copy.deepcopy(self.raw_data)
    newconf.files = copy.deepcopy(self.files)
    newconf.secondary_config_parsers = copy.deepcopy(
        self.secondary_config_parsers)
    newconf.writeback = copy.deepcopy(self.writeback)
    newconf.writeback_data = copy.deepcopy(self.writeback_data)
    newconf.global_override = copy.deepcopy(self.global_override)
    newconf.context_descriptions = copy.deepcopy(self.context_descriptions)
    newconf.constants = copy.deepcopy(self.constants)
    newconf.initialized = copy.deepcopy(self.initialized)
    return newconf
956152
def save(self):
        """"""
        with open(self._config_file_path, 'w') as file:
            self._config_parser.write(file)
1347396
def save_configs(self):
        

        try:
            config_path = os.path.join(self._working_directory, "configs")
            os.makedirs(config_path, exist_ok=True)
        except OSError as e:
            raise DynamipsError("Could could not create configuration directory {}: {}".format(config_path, e))

        startup_config_base64, private_config_base64 = yield from self.extract_config()
        if startup_config_base64:
            startup_config = self.startup_config_path
            try:
                config = base64.b64decode(startup_config_base64).decode("utf-8", errors="replace")
                config = "!\n" + config.replace("\r", "")
                config_path = os.path.join(self._working_directory, startup_config)
                with open(config_path, "wb") as f:
                    log.info("saving startup-config to {}".format(startup_config))
                    f.write(config.encode("utf-8"))
            except (binascii.Error, OSError) as e:
                raise DynamipsError("Could not save the startup configuration {}: {}".format(config_path, e))

        if private_config_base64 and base64.b64decode(private_config_base64) != b'\nkerberos password \nend\n':
            private_config = self.private_config_path
            try:
                config = base64.b64decode(private_config_base64).decode("utf-8", errors="replace")
                config_path = os.path.join(self._working_directory, private_config)
                with open(config_path, "wb") as f:
                    log.info("saving private-config to {}".format(private_config))
                    f.write(config.encode("utf-8"))
            except (binascii.Error, OSError) as e:
                raise DynamipsError("Could not save the private configuration {}: {}".format(config_path, e))
1362484
def _write(self):
        
        self.json_file.seek(0)
        self.json_file.truncate()
        dump = json.dumps(self.backup_dict)
        dump_c = zlib.compress(dump.encode('utf-8'))
        self.json_file.write(dump_c)
106680
def save(self):
        
        with open(self._user_config_file, 'w', encoding='utf-8') as f:
            self.write(f)
794097
def write_config(self):
        """"""
        config_file = os.path.join(self.config_dir, 'pueue.ini')
        with open(config_file, 'w') as file_descriptor:
            self.config.write(file_descriptor)
256444
def _storeConfig(self, config, configPath):
        
        self.logger.info("Writing to " + str(configPath))
        os.makedirs(os.path.dirname(configPath), exist_ok=True)
        with (open(configPath, 'w')) as yml:
            yaml.dump(config, yml, default_flow_style=False)
1011025
def save(self):
        
        config = self.profiledir + '/config'
        if not isdir(self.profiledir):
            makedirs(self.profiledir)

        cp = SafeConfigParser()

        cp.add_section('ssh')
        cp.set('ssh', 'private_key', self.ssh_private_key)
        cp.set('ssh', 'public_key', self.ssh_public_key)

        with open(config, 'w') as cfile:
            cp.write(cfile)
220436
def save(dir = Dir.pwd, config = {}, type = :local, options = {})
      conffile = config_file(dir, type, options)
      confdir  = File.dirname( conffile )
      unless File.directory?( confdir )
        warning "about to create the configuration directory #{confdir}"
        really_continue?  unless options[:no_interaction]
        run %( mkdir -p #{confdir} )
      end
      store_config(conffile, config, options)
    end
590996
def dump_config(self):
        
        path = os.path.join(tempfile.gettempdir(),
                            'dump-cfg-scheduler-%s-%d.json' % (self.name, int(time.time())))

        try:
            self.pushed_conf.dump(path)
        except (OSError, IndexError) as exp:  # pragma: no cover, should never happen...
            logger.critical("Error when writing the configuration dump file %s: %s",
                            path, str(exp))
563787
def save_conf(fn=None):
    
    if fn is None:
        fn = cfile()
    try:
        os.makedirs(os.path.dirname(fn))
    except (OSError, IOError):
        pass
    with open(fn, 'w') as f:
        yaml.dump(conf, f)
603697
def write(self):
        """"""
        with open(self.path, 'w') as f:
            self.config.write(f)
422442
def main(self) -> None:
        """"""
        path = ask_path("where should the config be stored?", ".snekrc")

        conf = configobj.ConfigObj()

        tools = self.get_tools()
        for tool in tools:
            conf[tool] = getattr(self, tool)()  # pylint: disable=assignment-from-no-return
        conf.filename = path
        conf.write()

        print("Written config file!")

        if "pylint" in tools:
            print(
                "Please also run `pylint --generate-rcfile` to complete setup")