public void pedantic(String msg) { if (!_pedanticRecord) { return; } pedantic(msg, TAG_PEDANTIC); }
private void processGroup(String groupName, boolean clusterGroup, boolean removeApplyLine) { try { List<ParseTree> applyGroupsLines = _hierarchy.getApplyGroupsLines( groupName, _currentPath, _configurationContext, clusterGroup); int insertionIndex = _newConfigurationLines.indexOf(_currentSetLine); _newConfigurationLines.addAll(insertionIndex, applyGroupsLines); } catch (PartialGroupMatchException e) { _w.pedantic(applyGroupsExceptionMessage(groupName, e)); } catch (UndefinedGroupBatfishException e) { String message = String.format( "apply-groups statement at %s refers to non-existent group: '%s'\n", pathString(), groupName); _w.redFlag(message); } catch (BatfishException e) { _w.redFlag(applyGroupsExceptionMessage(groupName, e)); } if (removeApplyLine) { _newConfigurationLines.remove(_currentSetLine); } _changed = true; }
/** * Updates {@link Region}'s mapping between {@link Configuration} names and {@link SecurityGroup} * for a given configuration. Also updates {@link org.batfish.datamodel.Ip} of instances in {@link * SecurityGroup} * * @param region {@link Region} in which the configuration is in * @param configuration {@link Configuration} for which security groups are to be processed * @param securityGroupsIds {@link List} of security group IDs * @param warnings {@link Warnings} for the configuration */ public static void processSecurityGroups( Region region, Configuration configuration, List<String> securityGroupsIds, Warnings warnings) { for (String sGroupId : securityGroupsIds) { SecurityGroup securityGroup = region.getSecurityGroups().get(sGroupId); if (securityGroup == null) { warnings.pedantic( String.format( "Security group \"%s\" for \"%s\" not found", sGroupId, configuration.getHostname())); continue; } region.updateConfigurationSecurityGroups(configuration.getHostname(), securityGroup); securityGroup.updateConfigIps(configuration); } }
private Interface addInterface(String name, Interface_nameContext ctx, boolean explicit) { Interface newInterface = _configuration.getInterfaces().get(name); if (newInterface == null) { newInterface = new Interface(name, _configuration); _configuration.getInterfaces().put(name, newInterface); initInterface(newInterface, ctx); } else { _w.pedantic("Interface: '" + name + "' altered more than once"); } newInterface.setDeclaredNames( new ImmutableSortedSet.Builder<String>(naturalOrder()) .addAll(newInterface.getDeclaredNames()) .add(ctx.getText()) .build()); if (explicit) { _currentInterfaces.add(newInterface); } return newInterface; }
if (settings.getReferenceBandwidth() != null) { if (iface.getBandwidth() == 0) { _w.pedantic( String.format( "Cannot use IS-IS reference bandwidth for interface '%s' because interface bandwidth is 0.",