From c39f4efede368be7ebe2a4c23e21ef396ffaed9c Mon Sep 17 00:00:00 2001 From: Pierre Rioux Date: Thu, 20 Sep 2018 00:45:11 -0400 Subject: fixing attribute comparison rule Change-Id: I81d9139e80b7d7e6432f178d107a28b4135ca0e2 Issue-ID: LOG-434 Signed-off-by: Pierre Rioux --- .../bundleconfig/etc/rules/poa-event/default-rules.groovy | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc') 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 c6699091f7..3f91f8bf71 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 @@ -213,14 +213,19 @@ rule { java.util.Map ndcb = getAttributes(slurper.parseText(ndcbItems.toString())) java.util.Map aai = getAttributes(slurper.parseText(aaiItems.toString())) - ndcb.each{ ndcbKey, ndcbValueList -> + boolean result = true + ndcb.any{ ndcbKey, ndcbValueList -> def aaiValueList = aai.get("$ndcbKey") aaiValueList.each{ aaiValue -> if(!ndcbValueList.any{ it == "$aaiValue" }) { - return false + result = false } } + if(result == false) { + // break out of 'any' loop + return true + } } - return true + return result ''' -} \ No newline at end of file +} -- cgit 1.2.3-korg