def _config_parser_v2(config_file, logname, meta_dp_state): config_path = config_parser_util.dp_config_path(config_file) top_confs = {top_conf: {} for top_conf in V2_TOP_CONFS} config_hashes = {} config_contents = {} dps = None if not config_parser_util.dp_include( config_hashes, config_contents, config_path, logname, top_confs): raise InvalidConfigError('Error found while loading config file: %s' % config_path) if not top_confs['dps']: raise InvalidConfigError('DPs not configured in file: %s' % config_path) dps = dp_preparsed_parser(top_confs, meta_dp_state) return (config_hashes, config_contents, dps, top_confs)
def _config_parser_v2(config_file, logname): config_path = config_parser_util.dp_config_path(config_file) top_confs = {} config_hashes = {} dps = None for top_conf in V2_TOP_CONFS: top_confs[top_conf] = {} if not config_parser_util.dp_include(config_hashes, config_path, logname, top_confs): assert False, 'Error found while loading config file: %s' % config_path elif not top_confs['dps']: assert False, 'DPs not configured in file: %s' % config_path else: dps = _dp_parser_v2(top_confs['acls'], top_confs['dps'], top_confs['meters'], top_confs['routers'], top_confs['vlans']) return (config_hashes, dps)
def _config_parser_v2(config_file, logname): logger = config_parser_util.get_logger(logname) config_path = config_parser_util.dp_config_path(config_file) top_confs = {} config_hashes = {} dps = None for top_conf in V2_TOP_CONFS: top_confs[top_conf] = {} if not config_parser_util.dp_include(config_hashes, config_path, logname, top_confs): logger.critical('error found while loading config file: %s', config_path) elif not top_confs['dps']: logger.critical('DPs not configured in file: %s', config_path) else: dps = _dp_parser_v2(logger, top_confs['acls'], top_confs['dps'], top_confs['meters'], top_confs['routers'], top_confs['vlans']) return (config_hashes, dps)
def _config_parser_v2(config_file, logname): config_path = config_parser_util.dp_config_path(config_file) top_confs = {} config_hashes = {} dps = None for top_conf in V2_TOP_CONFS: top_confs[top_conf] = {} if not config_parser_util.dp_include( config_hashes, config_path, logname, top_confs): raise InvalidConfigError('Error found while loading config file: %s' % config_path) elif not top_confs['dps']: raise InvalidConfigError('DPs not configured in file: %s' % config_path) else: dps = _dp_parser_v2( top_confs['acls'], top_confs['dps'], top_confs['meters'], top_confs['routers'], top_confs['vlans']) return (config_hashes, dps)
def _config_parser_v2(config_file, logname): logger = config_parser_util.get_logger(logname) config_path = config_parser_util.dp_config_path(config_file) config_hashes = {} top_confs = { 'acls': {}, 'dps': {}, 'routers': {}, 'vlans': {}, } if not config_parser_util.dp_include(config_hashes, config_path, logname, top_confs): logger.critical('error found while loading config file: %s', config_path) return None if not top_confs['dps']: logger.critical('DPs not configured in file: %s', config_path) return None dps = _dp_parser_v2(logger, top_confs['acls'], top_confs['dps'], top_confs['routers'], top_confs['vlans']) return (config_hashes, dps)