Fix parallelism

Change-Id: I4bab662d264f1947a37dab950e5bb640a8d02f0e
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index b2123c5..9aa9792 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -86,28 +86,23 @@
         def acc = 0
         for (int i = 0; i < nodes.size(); i++) {
           def testTarget = sh(script: "basename ${nodes[i]} .yml", returnStdout: true).trim()
-
-          if (acc < PARALLEL_NODE_GROUP_SIZE.toInteger()) {
-            branches[testTarget] = {
-              build job: "test-salt-model-node", parameters: [
-                [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: defaultGitUrl],
-                [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: defaultGitRef],
-                [$class: 'StringParameterValue', name: 'NODE_TARGET', value: testTarget],
-                [$class: 'StringParameterValue', name: 'EXTRA_FORMULAS', value: EXTRA_FORMULAS],
-                [$class: 'StringParameterValue', name: 'FORMULAS_SOURCE', value: formulasSource],
-                [$class: 'StringParameterValue', name: 'CREDENTIALS_ID', value: CREDENTIALS_ID],
-                [$class: 'StringParameterValue', name: 'SYSTEM_GIT_URL', value: SYSTEM_GIT_URL],
-                [$class: 'StringParameterValue', name: 'SYSTEM_GIT_REF', value: SYSTEM_GIT_REF]
-              ]}
-            acc++;
-          } else {
+          if (acc >= PARALLEL_NODE_GROUP_SIZE.toInteger()) {
             parallel branches
-            acc = 0
             branches = [:]
+            acc = 0
           }
-        }
-        if (acc > 0) {
-          parallel branches
+
+          branches[testTarget] = {
+            build job: "test-salt-model-node", parameters: [
+              [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: defaultGitUrl],
+              [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: defaultGitRef],
+              [$class: 'StringParameterValue', name: 'NODE_TARGET', value: testTarget],
+              [$class: 'StringParameterValue', name: 'EXTRA_FORMULAS', value: EXTRA_FORMULAS],
+              [$class: 'StringParameterValue', name: 'CREDENTIALS_ID', value: CREDENTIALS_ID],
+              [$class: 'StringParameterValue', name: 'SYSTEM_GIT_URL', value: SYSTEM_GIT_URL],
+              [$class: 'StringParameterValue', name: 'SYSTEM_GIT_REF', value: SYSTEM_GIT_REF]
+            ]}
+          acc++;
         }
       }
     }