Skip to content

Commit 0d92e2d

Browse files
committed
it keeps previous behavior not validatin tmp folder to exist
1 parent 371c545 commit 0d92e2d

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunnerContextBuilder.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,25 +1190,16 @@ String getExecutionSpecificTmpDir() {
11901190
String baseTmpDir = AnsibleUtil.getCustomTmpPathDir(framework);
11911191

11921192
if (executionId != null && !executionId.isEmpty()) {
1193-
java.nio.file.Path basePath = Paths.get(baseTmpDir);
1194-
try {
1195-
// createDirectories is idempotent: safe under concurrent invocations.
1196-
Files.createDirectories(basePath);
1197-
} catch (IOException e) {
1198-
String errorMsg = "Failed to ensure base tmp directory exists: " + basePath;
1199-
log.error(errorMsg, e);
1200-
throw new IllegalStateException(errorMsg, e);
1201-
}
1202-
1203-
// Atomic + unique by construction; the executionId prefix lets operators filter all
1204-
// directories belonging to a given Rundeck execution with a single glob.
1193+
// Atomic + unique by construction. No coordination needed between sibling threads
1194+
// sharing the same Rundeck executionId. The executionId prefix lets operators filter
1195+
// all directories belonging to a given Rundeck execution with a single glob.
12051196
try {
12061197
executionSpecificDir = Files
1207-
.createTempDirectory(basePath, "ansible-exec-" + executionId + "-builder-")
1198+
.createTempDirectory(Paths.get(baseTmpDir), "ansible-exec-" + executionId + "-builder-")
12081199
.toFile();
12091200
log.debug("Created builder-specific directory: {}", executionSpecificDir.getAbsolutePath());
12101201
} catch (IOException e) {
1211-
String errorMsg = "Failed to create builder-specific directory under: " + basePath;
1202+
String errorMsg = "Failed to create builder-specific directory under: " + baseTmpDir;
12121203
log.error(errorMsg, e);
12131204
throw new IllegalStateException(errorMsg, e);
12141205
}

0 commit comments

Comments
 (0)