From 9ff2d87264add68c2654df58365c77d7834f34e1 Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Fri, 1 Oct 2021 16:57:26 +0100
Subject: [PATCH] Don't fail without Slurm environment variable

---
 bin/slurm_calibrate.sh | 2 +-
 bin/slurm_finalize.sh  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/slurm_calibrate.sh b/bin/slurm_calibrate.sh
index 700f21c89..2d8dfccbf 100755
--- a/bin/slurm_calibrate.sh
+++ b/bin/slurm_calibrate.sh
@@ -21,7 +21,7 @@ echo "notebook: $notebook"
 echo "detector: $detector"
 echo "caltype: $caltype"
 echo "cluster_cores: $cluster_cores"
-echo "job ID: $SLURM_JOB_ID"
+echo "job ID: ${SLURM_JOB_ID:-none}"
 
 export CAL_NOTEBOOK_NAME="$notebook"
 
diff --git a/bin/slurm_finalize.sh b/bin/slurm_finalize.sh
index c0f632dd8..9eaf9a735 100644
--- a/bin/slurm_finalize.sh
+++ b/bin/slurm_finalize.sh
@@ -11,7 +11,7 @@ echo "Running with the following parameters:"
 echo "Python path: $python_path"
 echo "Correction temp dir: $temp_dir"
 echo "finalize script: $finalize_script"
-echo "job ID: $SLURM_JOB_ID"
+echo "job ID: ${SLURM_JOB_ID:-none}"
 
 # set-up enviroment
 source /etc/profile.d/modules.sh
-- 
GitLab