Reload Alignak configuration
        Format of the line that triggers function call::

        RELOAD_CONFIG

        :return: None
512939
def reload_config(self):
        
        reload_cmd = self.commands.find_by_name('reload-alignak')
        if not reload_cmd:
            logger.error("Cannot restart Alignak : missing command"
                         " named 'reload-alignak'. Please add one")
            return
        logger.warning("RELOAD command : %s", reload_cmd)
        reload_cmd_line = reload_cmd.command_line
        logger.warning("RELOAD command : %s", reload_cmd_line)

        # Ok get an event handler command that will run in 15min max
        e_handler = EventHandler({'command': reload_cmd_line, 'timeout': 900})
        # Ok now run it
        e_handler.execute()
        # And wait for the command to finish
        while e_handler.status not in [ACT_STATUS_DONE, ACT_STATUS_TIMEOUT]:
            e_handler.check_finished(64000)

        log_level = 'info'
        if e_handler.status == ACT_STATUS_TIMEOUT or e_handler.exit_status != 0:
            logger.error("Cannot reload Alignak configuration: the 'reload-alignak' command failed"
                         " with the error code '%d' and the text '%s'.",
                         e_handler.exit_status, e_handler.output)
            log_level = 'error'
        # Ok here the command succeed, we can now wait our death
        self.send_an_element(make_monitoring_log(log_level, "RELOAD: %s" % (e_handler.output)))
1259136
def load_configuration(self):
        """"""
        filename = os.path.join(os.path.dirname(__file__), 'templates/spline-loc.yml.j2')
        with open(filename) as handle:
            return Adapter(safe_load(handle)).configuration
16661
def reload_target!(options = {})
      old_options = @target_load_options || {}
      options = (@target_load_options || {}).merge(options)
      if options[:skip_first_time] && @target_load_count == 1
        @target_load_count += 1
      else
        load_target!(options.merge(reload: true))
      end
    end
930470
def reload(self):
        
        logging.debug('Reloading config file as files have been modified.')
        self.config.plugin, self.config.general = self.config.reload()
        logging.debug('Reloading plugins as files have been modified.')
        self.loader = plugin_manager.PluginLoader(
            self._plugin_path, self.config.plugin)
        self._plugin_mod_time = os.path.getmtime(self._plugin_path)
        self._config_mod_time = os.path.getmtime(self._config_file_path)
8021
def reload
      # TODO refactor cfg load and key retrieval, consolidate with initial load
      prev_pikelet_cfg = pikelet_definitions(@config.all)

      @config.reload

      current_pikelet_cfg = pikelet_definitions(@config.all)

      prev_keys    = prev_pikelet_cfg.keys
      current_keys = current_pikelet_cfg.keys

      removed     = prev_keys - current_keys
      added       = current_keys - prev_keys
      ask_running = current_keys - (added + removed)

      # for sections previously there and still there, ask them
      # to make the config change; they will if they can, or will signal
      # restart is needed if not
      # reload() returns trinary value here; true means the change was made, false
      # means the pikelet needs to be restarted, nil means no change
      # was required.
      ask_running.each do |ask_key|
        next unless pikelet = @pikelets.detect {|pik| ask_key == pik.type}

        if pikelet.reload(current_pikelet_cfg[pikelet.type]).is_a?(FalseClass)
          removed << pikelet.type
          added << pikelet.type
        end
      end

      pikelets_to_remove = @pikelets.select{|pik| removed.include?(pik.type) }
      pikelets_to_remove.map(&:stop)
      @pikelets -= pikelets_to_remove

      added_defs = current_pikelet_cfg.select {|k, v| added.include?(k) }

      create_pikelets(added_defs).each do |pik|
        @pikelets << pik
        pik.start
      end
    end
228265
def reload(self, config=None, debug=False):
        
        try:
            # log configuration handling
            # get log level
            # (if not in configuration file, log level is set to debug)
            level = get_loglevel(
                self._get_param(
                    'global',
                    'log.level',
                    config,
                    'debug',
                    )
                )
            # configure access log
            self._set_access_log(config, level)
            # configure error log
            self._set_error_log(config, level, debug)

            # load template files
            self._load_templates(config)

            # loading the auth configuration
            self._init_auth(config)

            # Loading the attributes
            self.attributes_file = \
                self._get_param('attributes', 'attributes.file', config)
            cherrypy.log.error(
                msg="loading attributes file '%(file)s'" %
                    {'file': self.attributes_file},
                severity=logging.DEBUG
            )

            self.notifications = {}

            self.attributes = Attributes(self.attributes_file)

            cherrypy.log.error(
                msg="init directories backends",
                severity=logging.DEBUG
            )
            self._init_backends(config)
            self._check_backends()

            # loading the ppolicy
            self._init_ppolicy(config)

            # loading custom javascript
            self._init_custom_js(config)

            cherrypy.log.error(
                msg="application started",
                severity=logging.INFO
            )

        except Exception as e:
            self._handle_exception(e)
            cherrypy.log.error(
                msg="application failed to start",
                severity=logging.ERROR
            )
            exit(1)
536954
def load(self):
    
    try:
      if not self.__in_memory:
        self._json = json.loads(self._load_from_configs(self._main_config))
        # ToDo: make this via extension for root logger
        # self._log = aLogger.getLogger(__name__, cfg=self)  # reload logger using loaded configuration
        self._load_modules()
      else:
        self._json = {}
      # parse command line, currently used for re-assign settings in configuration, but can't be used as replacement
      self._load_from_commandline()
    except Exception as err:
      self._json = None
      raise
576894
def make_module_reload_func(module_name=None, module_prefix='[???]', module=None):
    
    module = _get_module(module_name, module, register=False)
    if module_name is None:
        module_name = str(module.__name__)
    def rrr(verbose=True):
        """ Dynamic module reloading """
        if not __RELOAD_OK__:
            raise Exception('Reloading has been forced off')
        try:
            import imp
            if verbose and not QUIET:
                builtins.print('RELOAD: ' + str(module_prefix) + ' __name__=' + module_name)
            imp.reload(module)
        except Exception as ex:
            print(ex)
            print('%s Failed to reload' % module_prefix)
            raise
    # this doesn't seem to set anything on import *
    #_inject_funcs(module, rrr)
    return rrr
152583
def refreshAlignmentUi(self):
        
        align = self.alignment()
        for name, value in (('align_left', Qt.AlignLeft),
                            ('align_right', Qt.AlignRight),
                            ('align_center', Qt.AlignHCenter),
                            ('align_justify', Qt.AlignJustify)):
            
            act = self._actions[name]
            act.blockSignals(True)
            act.setChecked(value == align)
            act.blockSignals(False)
465403
def reload
      resp = send_recv( KJess::Request::Reload.new )
      return KJess::Response::ReloadedConfig === resp
    end
980892
def _load_yaml_config(cls, config_data, filename="(unknown)"):
        """"""

        try:
            config = yaml.safe_load(config_data)
        except yaml.YAMLError as err:
            if hasattr(err, 'problem_mark'):
                mark = err.problem_mark
                errmsg = ("Invalid YAML syntax in Configuration file "
                          "%(file)s at line: %(line)s, column: %(column)s."
                          % dict(file=filename,
                                 line=mark.line + 1,
                                 column=mark.column + 1))
            else:
                errmsg = ("YAML error reading Configuration file "
                          "%(file)s"
                          % dict(file=filename))
            logger.error(errmsg)
            raise

        logger.info("Configuration: %s", config)
        return config
561233
def read(self):
        
        logger.info("Reloading %s ..." % self.__configfile)

        # smash the previous config
        self._configparser = configparser.SafeConfigParser()
        self._configparser.read([self.__configfile])

        sections = set()
        for setting in self.settings.values():
            sections.add(setting.section)
        for section in sections:
            # make sure that all the sections exist
            if not self._configparser.has_section(section):
                self._configparser.add_section(section)

        for setting in self.settings.values():
            setting.load(self._configparser)
362951
def reload_settings(*args, **kwargs):
    
    global settings
    setting, value = kwargs['setting'], kwargs['value']
    if setting == XRAY_NAMESPACE:
        settings = XRaySettings(value)
87542
def reload_on_change(name)
      logger.debug "reload_on_change(#{name.inspect}), reload_disabled=#{self.reload_disabled?}"
      if changed = config_changed?(name) && reload?
        if self.cache_hash[name]
          flush_cache(name)  # flush cached config values.
          fire_on_load(name) # force on_load triggers.
        end
      end
      changed
    end
851898
def set_reload_params(self, mercy=None, exit=None):
        
        self._set('reload-mercy', mercy)
        self.set_exit_events(reload=exit)

        return self._section
182372
def extract_formats(config_handle):
    
    configurations = dict(config_handle)
    formats = dict(configurations.get('formats', {}))
    return formats
969412
def reload
      # Make sure we have a fresh cache after we reload
      config.cache.clear if config.cache.respond_to?(:clear)

      # Reload dependencies as well, if necessary
      ActiveSupport::Dependencies.clear if defined?(ActiveSupport::Dependencies)

      # Use current configuration, but skip bundle and autoloading initializers
      current_config = config.marshal_dump.dup
      current_config.merge! :skip_bundle => true#, :skip_autoloading => true)

      initialize current_config
    end