From d0cf4bff19dd2d8da0950aebb27bc62c223e6810 Mon Sep 17 00:00:00 2001 From: Justin Coffi <21188264+jcoffi@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:47:34 -0700 Subject: [PATCH] fix: write plan artifacts to the run's unique temp dir, not its parent tf_initplan built tfplan.bin, tfplan.json and tfgraph.dot under os.path.dirname(temp_dir.name). temp_dir is the per-process TemporaryDirectory, so taking its parent collapses the path back to the shared temp root (usually /tmp) and the three files land at fixed, shared paths. Two terravision runs at once then write to the same /tmp/tfplan.bin (and .json/.dot) and overwrite each other's plan and graph mid-run. Use temp_dir.name directly so each run keeps its artifacts in its own directory. temp_dir.name is already stored as terraform_init_dir and _decode_plan reads the same local paths, so nothing else changes. --- modules/tfwrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tfwrapper.py b/modules/tfwrapper.py index 49bec3d..2f22bb4 100644 --- a/modules/tfwrapper.py +++ b/modules/tfwrapper.py @@ -352,7 +352,7 @@ def tf_initplan( vf if os.path.isabs(vf) else os.path.join(START_DIR, vf) for vf in varfile ] # Setup temporary file paths - tempdir = os.path.dirname(temp_dir.name) + tempdir = temp_dir.name tfplan_path = os.path.join(tempdir, "tfplan.bin") tfplan_json_path = os.path.join(tempdir, "tfplan.json") tfgraph_path = os.path.join(tempdir, "tfgraph.dot")