Performs the final steps of config initialization.
18827
def FinalizeConfigInit(config,
                       token,
                       admin_password = None,
                       redownload_templates = False,
                       repack_templates = True,
                       prompt = True):
  """"""
  config.Set("Server.initialized", True)
  print("\nWriting configuration to %s." % config["Config.writeback"])
  config.Write()
  print("Initializing the datastore.")
  # Reload the config and initialize the GRR database.
  server_startup.Init()

  print("\nStep 3: Adding GRR Admin User")
  try:
    CreateUser("admin", password=admin_password, is_admin=True)
  except UserAlreadyExistsError:
    if prompt:
      # pytype: disable=wrong-arg-count
      if ((builtins.input("User 'admin' already exists, do you want to "
                          "reset the password? [yN]: ").upper() or "N") == "Y"):
        UpdateUser("admin", password=admin_password, is_admin=True)
      # pytype: enable=wrong-arg-count
    else:
      UpdateUser("admin", password=admin_password, is_admin=True)

  print("\nStep 4: Repackaging clients with new configuration.")
  if prompt:
    redownload_templates = RetryBoolQuestion(
        "Server debs include client templates. Re-download templates?", False)
    repack_templates = RetryBoolQuestion("Repack client templates?", True)
  if redownload_templates:
    InstallTemplatePackage()
  # Build debug binaries, then build release binaries.
  if repack_templates:
    repacking.TemplateRepacker().RepackAllTemplates(upload=True, token=token)
  print("\nGRR Initialization complete! You can edit the new configuration "
        "in %s.\n" % config["Config.writeback"])
  print("Please restart the service for the new configuration to take "
        "effect.\n")
748686
def init():
    """"""
    default_config_path = path.join(
        (os.environ.get('TLDR_CONFIG_DIR') or path.expanduser('~')),
        '.tldrrc')
    if path.exists(default_config_path):
        click.echo("There is already a config file exists, "
                   "skip initializing it.")
    else:
        repo_path = click.prompt("Input the tldr repo path(absolute path)")
        if not path.exists(repo_path):
            sys.exit("Repo path not exist, clone it first.")

        platform = click.prompt("Input your platform(linux, osx or sunos)")
        if platform not in ['linux', 'osx', 'sunos']:
            sys.exit("Platform should be in linux, osx or sunos.")

        colors = {
            "description": "blue",
            "usage": "green",
            "command": "cyan"
        }

        config = {
            "repo_directory": repo_path,
            "colors": colors,
            "platform": platform
        }
        with open(default_config_path, 'w') as f:
            f.write(yaml.safe_dump(config, default_flow_style=False))

        click.echo("Initializing the config file at {0}".format(
            default_config_path))
635101
def process_settings(self, settings):
        """"""
        logging.debug("Using configuration from: %s", settings.name)
        exec(compile(settings.read(), settings.name, 'exec'), globals(), locals())
105051
def finalize(self):
        
        if self.rc_file:
            self.rc_file.close()
        if self.env_file:
            self.env_file.close()
1340973
public void finalizeConfiguration() {
        for (ConfigItem type : disabledItemsHolder.keys()) {
            for (Class<?> item : disabledItemsHolder.get(type)) {
                final DisableSupport info = getOrCreateInfo(type, item);
                info.getDisabledBy().addAll(disabledByHolder.get(getType(item)));
            }
        }
    }
1336541
public void configure() {
	  if (configurator != null && !underConfiguration.get() &&
			  underConfiguration.compareAndSet(false, true)) {
		 try {
			  configurator.configure(this);
		 } finally {
			 underConfiguration.set(false);
		 }
	  }
  }
1234901
public function onConfigUpdated()
    {
        parent::onConfigUpdated();

        if (($order = ini_get('request_order')) || ($order = ini_get('variables_order'))) {
            $this->variablesOrder = $order;
        } else {
            $this->variablesOrder = null;
        }
    }
817597
protected function initialize() : void
    {
        $driver = $this->config->getMetadataDriverImpl();
        if ($driver === null) {
            throw ConfigurationException::noMetadataDriverConfigured();
        }

        $this->driver      = $driver;
        $this->evm         = $this->dm->getEventManager();
        $this->initialized = true;
    }
594134
public synchronized static void initConfig(Map<ConfigProperty, String> initialValues) {
        SeLionLogger.getLogger().entering(initialValues);

        // only do this if the global config is not already initialized.
        if (xmlConfig == null) {
            xmlConfig = new XMLConfiguration();
            // don't auto throw, let each config value decide
            xmlConfig.setThrowExceptionOnMissing(false);
            // because we can config on the fly, don't auto-save
            xmlConfig.setAutoSave(false);

            // Set defaults
            loadInitialValues();
        }

        /*
         * otherwise, update the global config
         */

        // Load in our supplied values (if defined)
        loadValuesFromUser(initialValues);

        // Load in environment & system variables (if defined)
        loadValuesFromEnvironment();

        // Init Selenium configuration
        boolean runLocally = xmlConfig.getBoolean(ConfigProperty.SELENIUM_RUN_LOCALLY.getName());
        if (runLocally) {
            xmlConfig.setProperty(ConfigProperty.SELENIUM_HOST.getName(), "localhost");
        }

        SeLionLogger.getLogger().exiting();
    }
387334
public void run() {
    LOGGER.debug("begin scan for config file changes ...");
    try {
      Date lastModified = new Date(_xmlConfigFile.lastModified());

      if (_lastTimeRead == null || lastModified.after(_lastTimeRead)) {
        LOGGER.info("loading config file changes ...");
        this.loadServiceConfigFile();
        _lastTimeRead = new Date();
      }
    } catch (ConfigurationException e) {
      e.printStackTrace();
      LOGGER.error( "Error loading configuation file: ", e );
    }
    LOGGER.debug("finish scan for config file changes");
  }
13397
public function initialize()
    {
        if (!$this->checked) {
            $this->config->checkConfig();
            $this->checked = true;
            $this->data = $this->config->get($this->path, $this->default);
        }
    }
758081
def init_config(options={})
      options = options.to_symbol_keys

      if !options[:method]
        abort "Please provide a deployment method. e.g. #{METHODS.keys}"
      end

      @options = DEFAULT_OPTIONS.deep_merge(options)
      write_config
      check_gitignore
    end
1326546
protected function initializeConfigs()
    {
        $this->mergeConfigFrom(static::getConfigPath(), static::getConfigRootKeyName());

        $this->publishes([
            realpath(static::getConfigPath()) => config_path(basename(static::getConfigPath())),
        ], 'config');
    }
951070
protected function initConfig()
    {
        if (defined('CONFIG_FILE') && file_exists(CONFIG_FILE)) {
            $this->config = include_once CONFIG_FILE;
        }

        // Inject Config Container
        $config_container = ConfigContainer::component();
        foreach ($this->config as $config_name => $config_content) {
            $config_container->set($config_name, $config_content);
            yield;
        }
        $this->config = [];
        Lb::app()->containers['config'] = $config_container;
    }
1252231
public function initializeConfig()
    {
        $this->configInitialized = true;

        $this->setThemePath($this->app['config']->get('general'));

        $theme = $this->app['config']->get('theme');
        if (isset($theme['template_directory'])) {
            $this->setPath('templatespath', $this->getPath('theme') . '/' . $theme['template_directory']);
        } else {
            $this->setPath('templatespath', $this->getPath('theme'));
        }

        $branding = '/' . trim($this->app['config']->get('general/branding/path'), '/') . '/';
        $this->setUrl('bolt', $branding);
    }
727140
public void initAtStartup() {
        //final String appsToInit = ConfigurationManager.getConfigInstance().getString("evcache.appsToInit");
        final String appsToInit = EVCacheConfig.getInstance().getDynamicStringProperty("evcache.appsToInit", "").get();
        if (appsToInit != null && appsToInit.length() > 0) {
            final StringTokenizer apps = new StringTokenizer(appsToInit, ",");
            while (apps.hasMoreTokens()) {
                final String app = getAppName(apps.nextToken());
                if (log.isDebugEnabled()) log.debug("Initializing EVCache - " + app);
                initEVCache(app);
            }
        }
    }
1253356
public function initConfigs()
    {
        // Check configurations
        if (empty($this->configurations)) {
            return;
        }

        // Get available configurations
        $available = $this->getConfigurations();

        // Iterate
        foreach ($this->configurations as $component => $file) {
            // Check if configuration asked exists
            if (!array_key_exists($component, $available)) {
                continue;
            }

            $service = $this->get($component);

            // Check service integrity
            if (!$service) {
                continue;
            }

            // Initialize service
            $service->setPath($file);
            $service->init();
        }
    }