'Iterate over all the sections in the config file and validate them.'

def ValidateConfig(self, config_file=None):

    logging.debug('Processing    %s', config_file)
    if isinstance(config_file, config_lib.GrrConfigManager):
        conf_obj = config_file
    else:
        conf_obj = config.CONFIG.MakeNewConfig()
        conf_obj.Initialize(filename=config_file, reset=True)
    with utils.MultiStubber((config, 'CONFIG', conf_obj), (config_lib, '_CONFIG', conf_obj)):
        all_sections = conf_obj.GetSections()
        errors = conf_obj.Validate(sections=all_sections)
    return errors
