diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main')
2 files changed, 10 insertions, 14 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java index 78c01cfdfc..b3d346177b 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java @@ -58,7 +58,7 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator { if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) { return; } - String[] regexList = new String[]{".*_net_id", ".*_net_name", ".*_net_fqdn"}; + String[] regexList = {".*_net_id", ".*_net_name", ".*_net_fqdn"}; heatOrchestrationTemplate .getResources() @@ -97,9 +97,9 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator { private void checkNeutronPortFixedIpsName(String fileName, Map.Entry<String, Resource> resourceEntry, GlobalValidationContext globalContext) { - String[] regexList = - new String[]{"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)", - "[^_]+_[^_]+_v6_ip_(\\d+)"}; + String[] regexList = {"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)", + "[^_]+_[^_]+_v6_ip_(\\d+)", "[^_]+_[^_]+_[^_]+_ips", "[^_]+_[^_]+_[^_]+_v6_ips", + "[^_]+_[^_]+_[^_]+_ip_(\\d+)", "[^_]+_[^_]+_[^_]+_v6_ip_(\\d+)"}; if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { return; @@ -128,13 +128,9 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator { String fixedIpsName = ValidationUtil .getWantedNameFromPropertyValueGetParam(fixedIpsEntry.getValue()); - if (nonNull(fixedIpsName) && !ValidationUtil - .evalPattern(fixedIpsName, regexList)) { - globalContext.addMessage( - fileName, - ErrorLevel.WARNING, ErrorMessagesFormatBuilder.getErrorWithParameters( - ERROR_CODE_NNP1, - Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES.getErrorMessage(), + + if (nonNull(fixedIpsName) && !ValidationUtil.evalPattern(fixedIpsName, regexList)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder.getErrorWithParameters(ERROR_CODE_NNP1, Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES.getErrorMessage(), "Port", "Fixed_IPS", fixedIpsName, resourceEntry.getKey())); } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java index 4f640dff29..b1a8fe254d 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java @@ -192,15 +192,15 @@ public class NovaServerNamingConventionGuideLineValidator implements ResourceVal }else if (network instanceof List){ role = getNetworkRole((String)((List) network).get(0)); } - if (role != null && uniqueResourcePortNetworkRole.containsKey(role)) { + if (role != null && (uniqueResourcePortNetworkRole.containsKey(role))) { globalValidationContext.addMessage( fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder.getErrorWithParameters( ERROR_CODE_NNS12, Messages.RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE - .getErrorMessage(), resourceId, role)); + .getErrorMessage(), role, resourceId)); } else { - uniqueResourcePortNetworkRole.put(role, portResourceId); + uniqueResourcePortNetworkRole.put(role, resourceId); } } } |