Skip to content

Commit a02e32b

Browse files
committed
Merge branch 'adrien_slurm' of github.com:aalitaiga/smartdispatch into adrien_slurm
2 parents 5bd3c86 + bd104b0 commit a02e32b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

smartdispatch/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ def detect_cluster():
135135
def get_slurm_cluster_name():
136136
try:
137137
stdout = Popen("sacctmgr list cluster", stdout=PIPE, shell=True).communicate()[0]
138-
except OSError:
138+
stdout = stdout.decode()
139+
cluster_name = stdout.splitlines()[2].strip().split(' ')[0]
140+
except IndexError, OSError:
139141
return None
140-
stdout = stdout.decode()
141-
cluster_name = stdout.splitlines()[2].strip().split(' ')[0]
142142
return cluster_name
143143

144144
def get_launcher(cluster_name):

0 commit comments

Comments
 (0)