summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java
diff options
context:
space:
mode:
authorBen David, Elad (eb7504) <eb7504@intl.att.com>2019-11-03 17:22:48 +0200
committerBen David, Elad (eb7504) <eb7504@intl.att.com>2019-11-05 15:52:05 +0200
commit1e61754c29fc99636de692a0fb9d2ef1a4ba9e61 (patch)
tree90c20331d442c82dc955b0426d60b64a6ca353be /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java
parent4a6e592af14fd3941df6e56e5b75c9ac5d5eb01b (diff)
Align logging to Onap-ELS 2019.11
Change-Id: I1750493d5c9f2eab8c1395f0fbc9ae66cf74b0a6 Issue-ID: SDC-2639 Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java18
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java6
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);
}
}
}