1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-11-22 08:29:54 +00:00

Wrap sinfo call in a try/catch and default to rackham on failure

This commit is contained in:
Pontus Freyhult 2021-04-08 09:49:42 +02:00
parent fa1b4cb412
commit be6ea0060f

View file

@ -9,7 +9,12 @@ singularity {
enabled = true
}
def hostname = "sinfo --local -N -h | head -1 | cut -f1 -d' ' ".execute().text.trim()
def hostname = "r1"
try {
hostname = "sinfo --local -N -h | head -1 | cut -f1 -d' ' ".execute().text.trim()
} catch (java.io.IOException e) {
System.err.println("WARNING: Could not run sinfo to determine current cluster, defaulting to rackham")
}
// closure to create a suitable clusterOptions
def clusterOptionsCreator = { m ->