Fix failing cc test
Change-Id: I1b5438ee5133cbd1aaa103153fc704714c85afe0
Related: PROD-21047
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index ba05406..14c49be 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -174,11 +174,10 @@
stage("test-nodes") {
def partitions = common.partitionList(contextFileList, PARALLEL_NODE_GROUP_SIZE.toInteger())
def buildSteps = [:]
- for (int i = 0; i < partitions.size(); i++) {
- def partition = partitions[i]
+ partitions.eachWithIndex { partition, i ->
buildSteps.put("partition-${i}", new HashMap<String,org.jenkinsci.plugins.workflow.cps.CpsClosure2>())
- for(int k = 0; k < partition.size; k++){
- def basename = sh(script: "basename ${partition[k]} .yml", returnStdout: true).trim()
+ for(part in partition){
+ def basename = sh(script: "basename ${part} .yml", returnStdout: true).trim()
def testEnv = "${env.WORKSPACE}/model/${basename}"
buildSteps.get("partition-${i}").put(basename, { testModel(basename, testEnv) })
}