(self, configfile=None, override_config=None)
Process a configfile, or reload if previously given one.
Process a configfile, or reload if previously given one.
Process a configfile or reload if previously given one .
def load_config(self, configfile=None, override_config=None):
        """
        Process a configfile, or reload if previously given one.
        """
        self.config = configobj.ConfigObj()

        # Load in the collector's defaults
        if self.get_default_config() is not None:
            self.config.merge(self.get_default_config())

        if configfile is not None:
            self.configfile = os.path.abspath(configfile)

        if self.configfile is not None:
            config = load_config(self.configfile)

            if 'collectors' in config:
                if 'default' in config['collectors']:
                    self.config.merge(config['collectors']['default'])

                if self.name in config['collectors']:
                    self.config.merge(config['collectors'][self.name])

        if override_config is not None:
            if 'collectors' in override_config:
                if 'default' in override_config['collectors']:
                    self.config.merge(override_config['collectors']['default'])

                if self.name in override_config['collectors']:
                    self.config.merge(override_config['collectors'][self.name])

        self.process_config()
def load_config ( self , configfile = None , override_config = None ) : self . config = configobj . ConfigObj ( ) # Load in the collector's defaults if self . get_default_config ( ) is not None : self . config . merge ( self . get_default_config ( ) ) if configfile is not None : self . configfile = os . path . abspath ( configfile ) if self . configfile is not None : config = load_config ( self . configfile ) if 'collectors' in config : if 'default' in config [ 'collectors' ] : self . config . merge ( config [ 'collectors' ] [ 'default' ] ) if self . name in config [ 'collectors' ] : self . config . merge ( config [ 'collectors' ] [ self . name ] ) if override_config is not None : if 'collectors' in override_config : if 'default' in override_config [ 'collectors' ] : self . config . merge ( override_config [ 'collectors' ] [ 'default' ] ) if self . name in override_config [ 'collectors' ] : self . config . merge ( override_config [ 'collectors' ] [ self . name ] ) self . process_config ( )