1 class NodesController < ApplicationController
3 @objects = model_class.order("created_at desc")
6 IO.popen('sinfo --noheader --Node || echo "compute[1-3] foo bar DOWN"').readlines.each do |line|
7 tokens = line.strip.split
8 nodestate = tokens.last
10 if (re = tokens.first.match /^([^\[]*)\[([-\d,]+)\]$/)
12 re[2].split(',').each do |number_range|
13 if number_range.index('-')
14 range = number_range.split('-').collect(&:to_i)
15 (range[0]..range[1]).each do |n|
16 nodenames << "#{nodeprefix}#{n}"
19 nodenames << "#{nodeprefix}#{number_range}"
23 nodenames << tokens.first
25 nodenames.each do |nodename|
26 @slurm_state[nodename] = nodestate.downcase