diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 90c839720fb7f..d6eeb2f444713 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -351,8 +351,9 @@ class ClusterFormationTasks { String key = entry.getKey() String name = taskName(parent, node, 'addToKeystore#' + key) Task t = configureExecTask(name, project, parentTask, node, esKeystoreUtil, 'add', key, '-x') + String settingsValue = entry.getValue() // eval this early otherwise it will not use the right value t.doFirst { - standardInput = new ByteArrayInputStream(entry.getValue().getBytes(StandardCharsets.UTF_8)) + standardInput = new ByteArrayInputStream(settingsValue.getBytes(StandardCharsets.UTF_8)) } parentTask = t }