fixing attribute comparison rule 81/67981/1
authorPierre Rioux <pierre.rioux@amdocs.com>
Thu, 20 Sep 2018 04:45:11 +0000 (00:45 -0400)
committerPierre Rioux <pierre.rioux@amdocs.com>
Thu, 20 Sep 2018 04:45:18 +0000 (00:45 -0400)
Change-Id: I81d9139e80b7d7e6432f178d107a28b4135ca0e2
Issue-ID: LOG-434
Signed-off-by: Pierre Rioux <pierre.rioux@amdocs.com>
kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy

index c669909..3f91f8b 100644 (file)
@@ -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
+}