Merge "fixing attribute comparison rule"
authorAlexis de Talhouët <alexis.de_talhouet@bell.ca>
Thu, 20 Sep 2018 12:50:10 +0000 (12:50 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 20 Sep 2018 12:50:10 +0000 (12:50 +0000)
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
+}