Fix: shutil import was inside finally block, causing NameError when shutil.move was called

This commit is contained in:
2026-04-28 16:22:39 +00:00
parent c34e4aa376
commit 2e337ff079
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -119,12 +119,17 @@ def run_subprocess_logged(cmd, job_id, step_name):
update_job(job_id, current_step=step_name, status="processing")
proc = subprocess.run(cmd, capture_output=True, text=True)
if proc.returncode != 0:
# Combine stdout + stderr za diagnostiko
err_msg = (proc.stderr or "") + "\n" + (proc.stdout or "")
update_job(
job_id,
status="failed",
error=f"{step_name}: {proc.stderr[-500:]}",
error=f"{step_name}: {err_msg[-800:].strip()}",
)
return False
# Tudi pri success-u beleži stderr za diagnostiko (samo zadnji del)
if proc.stderr and proc.stderr.strip():
update_job(job_id, last_step_log=proc.stderr[-500:].strip())
return True