Skip to content

Commit 68de057

Browse files
Fix issue with multiples queues not deleting nodes
1 parent f1a5474 commit 68de057

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

autoscaling/crontab/autoscale_slurm.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ def getClusters():
6666
def getNodeDetails(node):
6767
out = subprocess.Popen(['sinfo','-h','-n',node,'-o','"%f %R"'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
6868
stdout,stderr = out.communicate()
69-
output=stdout.split("\n")[0]
70-
if output[0] == '"':
71-
output=output[1:]
72-
if output[-1] == '"':
73-
output=output[:-1]
69+
for pot_output in stdout.split("\n"):
70+
if not "(null)" in pot_output and pot_output.strip() != '':
71+
output=pot_output
72+
if output[0] == '"':
73+
output=output[1:]
74+
if output[-1] == '"':
75+
output=output[:-1]
76+
else:
77+
continue
7478
return output
7579

7680
def getIdleTime(node):

0 commit comments

Comments
 (0)