summaryrefslogtreecommitdiffstats
path: root/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc
diff options
context:
space:
mode:
authorPierre Rioux <pierre.rioux@amdocs.com>2018-09-27 09:16:38 -0400
committerPierre Rioux <pierre.rioux@amdocs.com>2018-09-27 09:20:37 -0400
commit7a0ebf1d8e5576a69af2e70032788aee51101ccd (patch)
tree67f5015fa440aafd71864dd99d12f22b7fc9bd4a /kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc
parentf879691d0b29b706e49e44d361e0384ce8d8fad3 (diff)
updated comparison rule for dynamic err messages
Change-Id: I251b1cb003a6b342a98d9fe74256a5a9da241d62 Issue-ID: LOG-683 Signed-off-by: Pierre Rioux <pierre.rioux@amdocs.com>
Diffstat (limited to 'kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc')
-rw-r--r--kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy11
1 files changed, 7 insertions, 4 deletions
diff --git a/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
index 3f91f8bf71..ec38724b40 100644
--- a/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
+++ b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy
@@ -154,8 +154,8 @@ rule {
rule {
name 'NDCB-AAI-attribute-comparison'
category 'INVALID_VALUE'
- description 'Verify that every attribute in Network-Discovery is the same as in AAI'
- errorText 'Some attributes in Network-Discovery are not equal to attributes in AAI'
+ description 'Verify that all attributes in Network-Discovery are the same as in AAI'
+ errorText 'Error found with attribute "{0}"; value "{1}" does not exist in Network-Discovery'
severity 'ERROR'
attributes 'ndcbItems', 'aaiItems'
validate '''
@@ -214,11 +214,14 @@ rule {
java.util.Map aai = getAttributes(slurper.parseText(aaiItems.toString()))
boolean result = true
+ List<String> details = new ArrayList<>();
ndcb.any{ ndcbKey, ndcbValueList ->
def aaiValueList = aai.get("$ndcbKey")
aaiValueList.each{ aaiValue ->
if(!ndcbValueList.any{ it == "$aaiValue" }) {
result = false
+ details.add("$ndcbKey")
+ details.add("$aaiValue")
}
}
if(result == false) {
@@ -226,6 +229,6 @@ rule {
return true
}
}
- return result
+ return new Tuple2(result, details)
'''
-}
+} \ No newline at end of file